I'm using template binding to display a list of users. For each user, we have a yes/no radio button and a drop down. The options available in the drop down are dependent on the radio button. If the user picks "yes" in the radio, we give them 4 options in the drop down, if they select no, we give them 2 options.
I created a view model that contains an array of users and for each user I have an array of the available options for the drop down.
ex. viewModel= [{UserId: 1, RBValue: true, DropDownId: 3, DropDownOpts: [1,2,3,4]}, {UserId: 2, RBValue: false, DropDownId:1, DropDownOpts: [1,2]};
And then in my template I have a select as such:
<select source: DropDownOpts, value: DropDownId"></select
When the radio is updated, I modify the DropDOwnOpts for that item.
When the page loads, it works fine. The appropriate options appear in the dropdown list, but when I modify the DropDownOpts in the viewmodel, I can see the update in the console, but the options do not change.
Am I missing something obvious here? Or is this not possible (I'm sure I can do it via js, but would rather not).
Thanks for any help.
Hi Scott,
Are you using the Kendo UI DropDownList and the RadioButton? Could you please share the declarations and the binding logic?
Below I am posing some important notes on the MVVM pattern:
Regards,
Nikolay