[tw5] Question: Only show checked items from a simple data tiddler?

I have a simple data tiddler which is my data source for a tiddler that displays it as checkboxes and all that is working as it should.

The display tiddler probably uses code I got off the TW site, I’m sure…

<$tiddler tiddler=“Road Eats”>
<$list filter="[all[current]indexes[]sort[]]" variable=item>
<$checkbox index=<> checked=“1” unchecked=“0”/> <>

</$list>
</$tiddler>

And then that data tiddler is simple, like so…

Hardee’s: 0
Waffle House: 0
Captain D’s: 0
Jack in the Box: 0

What I’m interested in doing is putting another list of checkboxes above the existing one. The top/new one should just show those that are checked (i.e. has a value of 1 in the data tiddler.

I imagine that the same code would be used, but just with an extra param in the filter attribute, right? I searched through the filter operators, but couldn’t find it.

Thanks!

Man, it would have saved me a whole bunch of time if you had provided tiddlers for this so folk don’t have to build everything from scratch.

Regardless, that was a fun exercise !!!

Coding fun attached. Download and drag into TiddlyWiki.com for import and your analysis. (One “Road Eats” tiddler with the data, one “Test Thingy” tiddler with the filtering code.)

RoadEatsTiddlers.json (865 Bytes)

1 Like

cj,

Thanks so much for piddling with it.

The reason I didn’t include import type code was that I thought I was missing asimple filter operator or something like that.

Second, I think thi sis a really cool thing. I’d love to explore using json as my datasource more. many more options than just the simple dictionary list.

Third, the code you provided did not work in my own TW, but like you instructed, it worked on tw.com properly. Does your code use any new features? My version is 5.1.21 and I’ve never had to update it before.

Thanks so much!

Oh poop, TW versions. I am not up and up on the differences between versions, but I’m guessing that “filter” operand is the culprit.

You might want to consider upgrading your TiddlyWiki to the latest version (keeping a backup of your older version, of course.)

Well worth it, I think, to get to the newest version. Me thinks a good number of folk really burned the midnight oil to create the latest.

All of that said, if you must stay with 5.1.21 for any reason, drop a note as such here. I’m sure some enterprising person can come up with a right sweet alternative.

I searched this forum and found the upgrade post, and the handy tool!

That worked. And now I can use your code. Thanks!

Good stuff !

In the last couple of hours, the zen of making soup and then totally pigging out … an alternative approach came to mind.

Involves a little bit more code, and fun brain-age game.

Serving up alternative later, I think.

Okay, this new version gets Selected Check Boxes in two different ways, one that works with TiddlyWiki 5.2.0 and higher, and one that works with whatever 5.x versions that allow the “variable” attribute for ListWidgets.

RoadEatsTiddlers2.json (1.44 KB)