I'm trying to bind a unordered list of checkboxes to a dropdown. It's very similar to cascading dropdowns. The trouble is that when the ul is bound with the template the checkboxes aren't bound to the array in the view model right away. When I change the dropdown selected item the ul updates but the checkes don't update until I click on them. It's difficult to explain so I've created a jsbin here.
In the example, I check App1, then select Administrator from the dropdown, and then select Instructor from the dropdown. App1 is no longer checked but if I click App2 to check it, App1 becomes checked. So the binding must have occurred.
Any help would be appricated.
In the example, I check App1, then select Administrator from the dropdown, and then select Instructor from the dropdown. App1 is no longer checked but if I click App2 to check it, App1 becomes checked. So the binding must have occurred.
Any help would be appricated.
5 Answers, 1 is accepted
0

Jon
Top achievements
Rank 1
answered on 26 Feb 2013, 05:15 PM
0
Hi,
Daniel
the Telerik team
The problem occurs because value binding is used for the checkbox. Setting the value through the template syntax should resolve the problem. I updated the jsBin.
Kind regards,Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
0

Jon
Top achievements
Rank 1
answered on 04 Mar 2013, 08:05 PM
Daniel,
If I provide values for the membership array in the jsbin you provided, how do I get the checkboxes to bind to it. That is, if memberships is [2,3], the checkbox for App2, and App3 isn't initially checked.
If I provide values for the membership array in the jsbin you provided, how do I get the checkboxes to bind to it. That is, if memberships is [2,3], the checkbox for App2, and App3 isn't initially checked.
0
Accepted
Hello Jon,
Daniel
the Telerik team
The array values should be strings in order for the values to be matched and the checkboxes checked initially. I updated the sample.
Kind regards,Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!