Updating label on switch toggle

Thanks again !
So with your syntax, I get “true” in every instance.

I tried then without the single quote around ‘.checked’…
It works on the initial display but value isn’t adjusted when the switch status changes (like in your first example)

I tried also in dmx-text without the {{}} = same result.

I can see the checked value gets updated in dmx.app.data, but can’t get to dinamically update the label though.
This drives me crazy haha !

Just add a static name to the toggle input, like name="ag_toggle"

Then in the label use: {{ag_toggle.checked}} -> it will return true/false.

1 Like

That’s magic to me. Thank you very much. :wink:

Code for those wondering :

Can you elaborate a bit about why this works like this if you have a moment ?
Or point me to a doc/link so that I can understand the mechanics for later use.

Have a great evening !

When you are using a repeat, it has its own local scope and when you are targeting the static name it will only target the element in this scope.

Awesome ! Thanks for the clarification :slight_smile:

1 Like