Commit 5d02a5c6 authored by Luís Rudge's avatar Luís Rudge

no need to rebuild on update :)

parent 925c34d4
...@@ -30,13 +30,9 @@ ...@@ -30,13 +30,9 @@
ko.applyBindingsToNode(element, { options: options, optionsValue: optionsValue, optionsText: optionsText }, viewModel); ko.applyBindingsToNode(element, { options: options, optionsValue: optionsValue, optionsText: optionsText }, viewModel);
$(element).multiselect(ko.utils.unwrapObservable(multiSelectData.initOptions)); $(element).multiselect(ko.utils.unwrapObservable(multiSelectData.initOptions));
var ms = $(element).data('multiselect');
console.log(ms);
}, },
update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
var blockRefresh = $(element).data('blockRefresh') || false;
if (!blockRefresh) { $(element).multiselect("rebuild"); }
$.data(element, 'blockRefresh', false);
} }
}; };
} }
...@@ -151,7 +147,7 @@ ...@@ -151,7 +147,7 @@
// Build the dropdown and bind event handling. // Build the dropdown and bind event handling.
buildDropdown: function () { buildDropdown: function () {
//If options.includeSelectAllOption === true, add the include all checkbox //If options.includeSelectAllOption === true, add the include all checkbox
if (this.options.includeSelectAllOption && this.options.multiple) { if (this.options.includeSelectAllOption && this.options.multiple) {
this.$select.prepend('<option value="select-all-option">' + this.options.selectAllText + '</option>'); this.$select.prepend('<option value="select-all-option">' + this.options.selectAllText + '</option>');
} }
......
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