Commit 1782cb98 authored by Nicholas Nieslanik's avatar Nicholas Nieslanik

Fixing the initialization of the selected items in the multi-select for...

Fixing the initialization of the selected items in the multi-select for Knockout.js binding integration.  Currently a persisted binding value isn't being initialized correctly when using KO.  Instead the selectedOptions are only being set on during the update binding function or when the observableArray is changed.  With this fix, if the observableArray has initial values, they are selected as necessary.s
parent f1704292
......@@ -30,6 +30,8 @@
$(element).multiselect(config);
if (isObservableArray(listOfSelectedItems)) {
//set the initial selection state on the multi-select list
$(element).multiselect('select', ko.utils.unwrapObservable(listOfSelectedItems));
// Subscribe to the selectedOptions: ko.observableArray
listOfSelectedItems.subscribe(function (changes) {
var addedArray = [], deletedArray = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment