One final tweak to the code: instead of: ``` <$checkbox index=<<item>> checked="1" unchecked="0"/> <<item>><br/> ``` I suggest putting the item text within the body of the $checkbox widget, like this: ``` <$checkbox index=<<item>> checked="1" unchecked="0"> <<item>> </$checkbox><br/> ``` This allows you to click on the item text to toggle the checkbox.
-e On Tuesday, May 24, 2022 at 9:12:15 AM UTC-7 David wrote: > Thanks! > > That is perfect!. I think I have several other pages that can enjoy this > kind of feature, as well. > > On Tuesday, May 24, 2022 at 8:38:12 AM UTC-4 Eric Shulman wrote: > >> On Tuesday, May 24, 2022 at 4:36:35 AM UTC-7 David wrote: >> >>> ``` >>> <$list >>> filter="[<currentTiddler>indexes[]search:title:literal[Vegas]sort[]]" >>> variable=item> >>> ``` >>> >> But it seems your code snippet is not working with the variable/field in >>> there. It works fine when I put some static text there, though, as seen in >>> my line above. >>> >> >> The problem is due to the surrounding `<$tiddler tiddler="Dictionary >> Tiddler">... </$tiddler>` widget. >> Because of this, the reference to `{!!searchText}` is looking in >> "Dictionary Tiddler" for the field contents. >> One way around this is to remove the `$tiddler` widget and hard-code the >> "Dictionary Tiddler" title, like this: >> ``` >> <$list filter="[[Dictionary >> Tiddler]indexes[]search:title:literal{!!searchText}sort[]]" variable=item> >> <$checkbox tiddler="Dictionary Tiddler" index=<<item>> checked="1" >> unchecked="0"/> >> <<item>><br/> >> </$list> >> ``` >> This allows the `{!!searchText}` reference to point to a field in the >> tiddler containing the `<$list>` widget, rather than the "Dictionary >> Tiddler" itself. >> >> However... if the intention is to eventually enable lookups using >> different Dictionary Tiddlers, then the following code may be more useful: >> ``` >> <$edit-text field="searchText"/> >> <$select field="dictionary"> >> <option>Dictionary Tiddler</option> >> <option>Another Dictionary</option> >> <option>Some Other Dictionary</option> >> <option>etc...</option> >> </$select> >> <br> >> <$let searchText={{!!searchText}}> >> <$tiddler tiddler={{!!dictionary}}> >> <$list >> filter="[all[current]indexes[]search:title:literal<searchText>sort[]]" >> variable=item> >> >> <$checkbox index=<<item>> checked="1" unchecked="0"/> >> <<item>><br/> >> </$list> >> </$tiddler> >> </$let> >> ``` >> Basically, this sets a variable to the value of the searchText field >> before using `$tiddler` to change the current tiddler, >> and then uses the value of that variable in the filter syntax. It also >> lets you select a dictionary tiddler title from a >> droplist input, and then uses that title in the `$tiddler` widget, so >> that the lookup points to another dictionary while >> still using the searchText input from the current tiddler. >> >> enjoy, >> -e >> > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b573c5d5-0049-4964-b267-8b4e4f5d46e7n%40googlegroups.com.