I am creating a knockout js custom binding that will allow me to use data-binding with bootstrap multiselect. I need it to work for single <select>
's and also multiselects <select multiple="true">
. I am doing it in this jsfiddle
I have got it so that both single and multiselects can show the dropdown options and as new categories are added with the button, they show on the multiselect dropdown. I also want to update the viewmodels selectedItems which are _selectedCategory
for the single <select>
and '_selectedCategories' for the multiselect.
I have added some buttons into the jsfiddle to test the bootstrap multiselect elements.
How can the viewmodels _selectedCategories
and _selectedCategory
be updated upon selecting the DOM elements from the dropdowns?
The code is in the jsfiddle