On Saturday, October 31, 2020 at 12:44:33 AM UTC-7, Gerald Weis wrote:
>
> this solution works wonderfully for one line,
> but how do i make it dynamic?
> My table currently has 15 rows. and at least one line is added every week.
I assume that the rows of the table are stored as separate tiddlers, where
each tiddler has fields: minval, maxval, and realval.
Then you could write something like this:
\define showRadioButtons()
<$list filter="[{!!realval}compare:number:lt{!!minval}]">
<input type=radio checked />
<input type=radio />
<input type=radio />
</$list>
<$list filter="[{!!realval}compare:number:gt{!!maxval}]">
<input type=radio />
<input type=radio />
<input type=radio checked />
</$list>
<$list
filter="[{!!realval}compare:number:gteq{!!minval}then{!!realval}compare:number:lteq{!!maxval}]">
<input type=radio />
<input type=radio checked />
<input type=radio />
</$list>
\end
<table>
<$list filter="[has[minval]has[maxval]has[realval]]">
<tr>
<td> <<currentTiddler>> </td>
<td> <<showRadioButtons>> </td>
</tr>
</$list>
</table>
Notes:
* For readability, I have placed the radiobutton display code into a macro
called <<showRadioButtons>>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/59cde46d-41a3-4e7c-bf3e-c02edeae6ab9o%40googlegroups.com.