vendredi 11 janvier 2019

Dynamic radio/checkbox solution in Aurelia

I have a gist demonstrating my problem here:

https://gist.run/?id=e2ccd5925e383f2fc36ad277c31bcf23

The checkbox version works fine, if you remove a check, it updates the model right, but if you change the selected radio button, it will keep the true value on the radio that got it's selection removed. If I remove the model.bind="true" value, it will write "on" instead of true. I do want true/false, and not on/off.

I want the object to get it's property updated to be a true or false depending on if it's chosen or not, dynamically. In my scenario I don't know how many radio buttons or checkboxes will need to be selected. I only know that in the cases of it not being a collection, I only want one, and in the case that it is a collection, I want an unknown number selected.




Aucun commentaire:

Enregistrer un commentaire