OK, this appears a tough one to crack. I've changed the code a bit and now
it's working well, though in a different way. Updates to status (via macro
calculations) are now triggered by button click that's located in each
tracker tiddler and not in the dashboard tiddler as I originally wanted it.
A bit less convenient but at least it works now (requires 2 clicks instead
of 1).
If anyone has suggestions as to how my original code could be improved to
meet the original goal I'd still appreciate your suggestions.
Thank you again.
Hubert
On Thursday, 2 November 2017 16:25:45 UTC, hubertgk wrote:
>
> Thanks for your input Jed.
>
> If I understand what is going on correctly the problem is that macros
>> don't necessarily trigger their own updates. So even if the value in a
>> field field that is passed to the macro changes it won't necessarily make
>> the output of the macro to change.
>>
>
> I'm aware of this. That's why I'm trying to use the button to trigger the
> macro.
>
> You don't actually show where in your code you use the Update_status macro
>> or what TrackerStatus macro does
>>
>
> The Updated_status macro is a macro I've defined ad-hoc and its output is
> used as a parameter in the button, that's also defined as a macro.
> TrackerStatus, on the other hand, is a javascript macro I wrote that uses
> the 4 fields as calculations and outputs a fancy unicode 'icon' and whether
> I'm ahead/behind of schedule and by how many days, but there's no issue
> there, it works correctly.
>
> If you always use the same field names than in your TrackerStatus macro
>> you can use {{!!tracker_current_value}}, {{!!tracker_target_value}},
>> {{!!tracker_current_date}} and {{!!tracker_end_date}} inside the macro and
>> then it will take those values from the tiddler where it is called and you
>> don't need to use the Update_status macro to just call another macro.
>>
>
> That's right, however these fields are in separate tiddlers than the macro
> that's evaluating them.
>
> Thanks again.
>
>
> On Thursday, 2 November 2017 16:14:07 UTC, Jed Carty wrote:
>>
>> If I understand what is going on correctly the problem is that macros
>> don't necessarily trigger their own updates. So even if the value in a
>> field field that is passed to the macro changes it won't necessarily make
>> the output of the macro to change.
>>
>> You don't actually show where in your code you use the Update_status
>> macro or what TrackerStatus macro does, but normally the solution is to put
>> the macro call inside a widget that will update when the inputs to the
>> macro changes. A set widget is often enough for this.
>>
>> This isn't directly related to your question, but you can probably
>> simplify your macros a bit. If you always use the same field names than in
>> your TrackerStatus macro you can use {{!!tracker_current_value}},
>> {{!!tracker_target_value}}, {{!!tracker_current_date}} and
>> {{!!tracker_end_date}} inside the macro and then it will take those values
>> from the tiddler where it is called and you don't need to use the
>> Update_status macro to just call another macro.
>>
>
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/b3825da0-8017-42fe-80f3-2d63e1aa2655%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.