I have two identical select lists as KnockoutJS Observable Arrays.
I want to be able to select a value from one and for it to disappear from the other and then if i change the first option for it to appear again.
Is there a simpler way than pushing and pulling the records out of the array?
Thanks,
Josh
I think the easiest way would be to have one observableArray and two computed which you use to bind options to. Then you’ll need two separate observables that you bind the value bindings to.
In the two computed you simply use
ko.utils.arrayFilterwhere you filter the observableArray using the selected value of the other.Does this make sense?