I am trying to make a simple KO custom bindings wrapper for the "options" binding similar to what is described in this example. My goal is to have a custom binding that will apply select2.js
to the specified select box.
I am trying to get started by just wrapping the options binding in a custom wrapper, but for some reason it is not working.
Here is what I have (jsFiddle) :
ko.bindingHandlers.select2 = {
init: function (element) {
ko.bindingHandlers.options.init(element);
},
update: function (element, valueAccessor, allBindingsAccessor) {
ko.bindingHandlers.options.update(element, valueAccessor, allBindingsAccessor);
}
};
Any help on this would be greatly appreciated.