Reputation: 6633
I have a situation where I have something like:
<select data-bind='options: [...], optionsText: "foo", optionsValue: "bar"'></select>
this is populating my select as expected. Is it possible to also set the visibility of the generated options based on some condition?
Upvotes: 0
Views: 67
Reputation: 5283
I would suggest adding a computed function on your view model which returns the required set, filtered with something like Underscore.js's filter function (or built however your logic dictates). Then bind to that function as the options parameter on the binding.
Upvotes: 1