Skip to content

Instantly share code, notes, and snippets.

jonesy827

Block or report user

Report or block jonesy827

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jonesy827
jonesy827 / knockout-select2.js
Last active May 23, 2018
Knockout Select2 version 3.x binding
View knockout-select2.js
ko.bindingHandlers.select2 = {
init: function (el, valueAccessor, allBindingsAccessor, viewModel) {
ko.utils.domNodeDisposal.addDisposeCallback(el, function () {
$(el).select2('destroy');
});
var allBindings = allBindingsAccessor();
var valueProperty = allBindings.valueProperty || 'value';
var textProperty = allBindings.textProperty || 'text';
You can’t perform that action at this time.