I have the following problem in Knockout.JS:
Let's suppose that I have an observable array of objects, rendered with the help of a template. Each one of them has two observable properties A and B. Both of these properties take their values from dropdowns (select/options binding).
My problem is that when the selected value of A changes for one object I also want to change the available (and selected) values of B for that specific object. I can't seem to find how this is done using knockout.
I could solve the problem using Javascript or Jquery to assign handlers to the onchange event of dropdown A and change the dropdown options of B manually - however I really don't want to pollute my design with that :(
So please answer me using only knockout's tools...
Thanks !
Take a look at the "Cart editor example" over at the Knockoutjs website. It includes an example of populating one combo box based on a parent combo box.
http://knockoutjs.com/examples/cartEditor.html
Maybe this helps?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With