The checkbox updates the data store Boolean value “randomise” on Value Changed, but I can not get the checkbox to work.
Where am I going wrong?
On repeat row creation I want the checkbox to be empty and then on change to be checked or unchecked by updating the data store boolean value on Value Changed. It loos like nothing is changing on Value Changed or alternatively Value Updated.
I just can not get it to work.
Any help to show how this should be and why if possible would be great
This is the closest I could get it to work. I have been unable to get the checkbox showing the Data store value even if “true”.
So I have reverted to clearing the check box on refresh by setting the Value to '' so the user has to select it again.
<tbody id=“poll_question_table” is=“dmx-repeat” dmx-bind:repeat=“questions.data” key="$id">
I have that bit working and seems to work just fine.
But if I refresh the page the fields in the form which ref the datastore are showing the correct value as in the data store, except the checkboxes and I just can’t seem to work out how to correctly display the checkbox based on the datastore value,
If the datastore boolean is ‘true’ the checkbox should be checked and when the datastore is false the checkbox should display unchecked. But all my attempts have failed.
I don’t understand what is the purpose of this in your checkbox code:
dmx-bind:value=“checked”
Why are you not using static value like 1 there? Why using a dynamic value?
In order to check or uncheck the checkbox based on an expression then use the dynamic checked attribute.
Example:
dmx-bind:checked="some_expression == 1"
will check the checkbox when some_expression equals 1. Replace some_expression with the expression you want to check and 1 with the value you expect it to return.