How to add search option in tiddlytables

I was trying to include search option seen in shiraz dynamic table into one of my dynamic table based on tiddlytables. Since its developer is not active in the community, @Mohammad can you help me with the code.
I was able to use the code you use for search in dynamic tables in a test table I created based on tiddlytables. But in my main table, I dont know how to include the search{$:/temp/demo/dtable/search} in the filter for tables by tiddlytables which is in a field called tbl-filter with field value as

[all[shadows+tiddlers]]+[field:tbl-type[year]]-[[Year]]

How to include search{$:/temp/demo/dtable/search} into the above filter.

Here is a demo wiki which shows the working search option in a test table based on tiddlytables and my main table based on tiddlytables.

Click on the tiddlytable search link in the topbar to see both tiddler together

If the filter is

[all[shadows+tiddlers]]+[field:tbl-type[year]]-[[Year]]

Then I assume the below shall work

[all[shadows+tiddlers]]+[field:tbl-type[year]]-[[Year]] :and[search{$:/temp/demo/dtable/search}]
1 Like

Thank you @Mohammad. It works.
But I have 4 tables which are nested within each other. Click on the Budget link in the topbar of this demo wiki. to see that table.

Is there a way to search all these tables from a single seach box in the highest table. Currently I have added search box for each of those 4 tables.

I think you should pass :and[search{$:/temp/demo/dtable/search}] to the filter param of those tables

I added :and[search{$:/temp/demo/dtable/search}] to the filter of each of the four tables, but the search is not working correctly.

Search works only if I add seperate search boxes in each of these nested tables (with different names) and corresponding versions of this code:and[search{$:/temp/demo/dtable/search}] in the filter for each tables. But this search works only in each of the individual tables, that too after I expand their contents.

I have updated the demo wiki to include the code in the table filter as you told. If you need to see the partially working search as I have told above, I will revert back the changes in the demo wiki.

I have not seen the demo, as I am on mobile now. But the dynamic tables works with filter, so if you limit the filter output by :and.

What in OP you said, you want to enter a keyword and wants to search in all those table, that means you need to pass :and[search{$:/temp/demo/dtable/search}]

Am I right?

I tried to add the :and[search{$:/temp/demo/dtable/search}] to all the tables, the search works but only in the individual tables.

The logic is the same. I have not read the code in your demo!
But searching in dynamic tables means pass extra conditions to filter param. No magic is there.

1 Like