1. i input the min-value.2. i input the high-value.3. i input the real-value.
Now should the radiowidget set himself the position
My next problem is that i must count the table-rows by hand.can this tiddlywiki do automaticly?
< min-value = low> high-valule = highothers = standardhow can i do that
my code at the time is thiskzu_tab define the table-headkzu_ein define the table-input
I enter 3 values1. the minimum value
2. the maximum value
3. the real measured value
The radio widget should now automatically change the value in the display.
If the real measured value is <than the minimum value, then the value should be set to 1.
If the real measured value is> than the maximum value, then the value should be set to 3.
Otherwise the value should be set to 2.
This provides an overview of how the value has changed, whether it is in the normal range, or whether it has moved up or down.
min: <$edit-text field="minval" />
max: <$edit-text field="maxval" />
real: <$edit-text field="realval" />
<$list filter="[{!!realval}compare:number:lt{!!minval}]">
LOW
</$list>
<$list filter="[{!!realval}compare:number:gt{!!maxval}]">
HIGH
</$list>
<$list filter="[{!!realval}compare:number:gteq{!!minval}then{!!realval}compare:number:lteq{!!maxval}]">
NORMAL
</$list>
min: <$edit-text field="minval" />
max: <$edit-text field="maxval" />
real: <$edit-text field="realval" />
<$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>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.
\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>Hello Eric,
Unfortunately, NOT every entry is a separate tiddler. That's why I also have the counter variable in my macro kzu_ein2. It defines the number of the row in the table.
The macro kzu_tab defines the head of the table. This table header is used in exactly the same way for other tables.
kzu_ein2 defines the input line of the table. This macro is called for every row in the table, currently 15 times in the table.
\define kzu_ein2(datum normvon normbis gewicht zaehler Wertung)
<tr align=right>
<td>$datum$</td>
<td>$normvon$ - $normbis$</td>
<td>$gewicht$</td>
<td>
<$list filter="[[$gewicht$]compare:number:lt[$normvon$]]"
emptyMessage="<input type=radio />">
<input type=radio checked />
</$list>
</td>
<td>
<$list filter="[[$gewicht$]compare:number:gt[$normbis$]]"
emptyMessage="<input type=radio />">
<input type=radio checked />
</$list>
</$list>
</td>
<td>
<$list filter="[[$gewicht$]compare:number:gteq[$normvon$]then[$gewicht$]compare:number:lteq[$normbis$]]"
emptyMessage="<input type=radio />">
<input type=radio checked />
</$list>
</td>
\end|!Datum |!Norm (kg) |!Gewicht |>|>|>|!Wertung |
|! |! |! |! - |! 0 |! + |
|18.09.2020 |55,3 - 67,6 | 68,0|<input type="radio">|<input type="radio">|<input type="radio" checked>|
|01.07.2020 |56,7 - 69,4 | 69,8|<input type="radio">|<input type="radio">|<input type="radio" checked>|
|11.03.2020 |56,5 - 69,0 | 70,6|<input type="radio">|<input type="radio">|<input type="radio" checked>|
...etc...
|>|>|>|>|>|!- = Neidrig, 0 = Norm, + = Hoch|