I have been experimenting with a custom dynamic table which can be seen here - My TiddlyWiki — a non-linear personal web notebook
There is an option to add multiple steps in the filter used to create the dynamic table.
I am using select widget to add operators and parameters for each filter steps. Whenever I am making some changes in filters steps, I use an update button to apply these changes to the final filter (whose value is stored in a field called tbl-filter-value
)
Currently I am manually adding update buttons for each level in the filter steps. I am defining variables for each level of these filter runs using let widget like filter1
if the number of filer steps is 1, filter2
if the number of filer steps is 2 and so on.
<$let
tbl-filter-steps-number={{!!row-number}}
op-1={{!!op-1-value}}
param-1={{!!param-1-value}}
op-2={{!!op-2-value}}
param-2={{!!param-2-value}}
filter1=`[$(op-1)$[$(param-1)$]search:$(tbl-search-field-list-join)$:$(tbl-search-flag-list-join)$[$(tbl-search-param)$]limit[$(tid-limit)$]]`
filter2=`[$(op-1)$[$(param-1)$]$(op-2)$[$(param-2)$]search:$(tbl-search-field-list-join)$:$(tbl-search-flag-list-join)$[$(tbl-search-param)$]limit[$(tid-limit)$]]`
>
In the update button, action setfield widget is used to apply the filter stored in the variables filter1
, filter2
etc into a field called tbl-filter-value
and this value is used to create the dynamic table.
<$list filter="[<currentTiddler>row-number[1]]">
<$button>
<$action-setfield $tiddler=<<currentTiddler>> tbl-filter-value=<<filter1>> $timestamp="no"/>
Update
</$button>
</$list>
<$list filter="[<currentTiddler>row-number[2]]">
<$button>
<$action-setfield $tiddler=<<currentTiddler>> tbl-filter-value=<<filter2>> $timestamp="no"/>
Update
</$button>
</$list>
What I want to do is to make the update button dynamic- that is to make it dynamically change the filter1, filter2 depending on the number of filter steps (which stored in a field called row number).
<$list filter="[<currentTiddler>row-number<tbl-filter-steps-number>]">
<$button>
<$action-setfield $tiddler=<<currentTiddler>> tbl-filter-value=?????? $timestamp="no"/>
Update
</$button>
</$list>
I tried many combinations, but I am not getting how to dynamcically change tbl-filter-value
in the setfield widget for the update button. Can someone help, I am lost for ideas.