On Saturday, October 31, 2020 at 3:00:47 AM UTC-7, Gerald Weis wrote:
>
> 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.
>
I think you would be better off using the power of TiddlyWiki to construct
the table output from separate tiddlers that hold the data in fields rather
than hard-coding literals as macro parameters. This would allow you
MUCH more flexibility to reference the stored field values in other places.
However, given your current implementation, try this:
\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
Notes:
* Each $list compares the "$gewicht$" parameter value with the $normvon$
and/or $normbis$ values,
and, if the comparison is true, it shows a checked radio button; otherwise
it shows an unchecked radio button
* Since you are passing in values for normvon, normbis, and gewicht, there
is no need to use
"gewichtNN" field values to hold "1", "2" or "3"
Also... since you are hand-coding and passing constant values into the
macro just to
produce formatted table output, you could omit all the macros, and just
using wikitext
table syntax directly, like this:
|!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|
-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/cee63b1f-96db-4608-aa3a-beddb4cd66b3o%40googlegroups.com.