Open sensugaz opened 7 years ago
Try this. $element.data('select2').destroy();
Starting on line 194 in select2.js, update the following lines of code to check if elem has class. If so, then call the appropriate functions.
elm.bind("$destroy", function () {
if (elm.hasClass('.select2-offscreen')) {
elm.select2("destroy");
}
});
attrs.$observe('disabled', function (value) {
if (elm.hasClass('.select2-offscreen')) {
elm.select2('enable', !value);
}
});
attrs.$observe('readonly', function (value) {
if (elm.hasClass('.select2-offscreen')) {
elm.select2('readonly', !!value);
}
});
var select = $(".select2").select2(); select.select2('destroy'); your data set select.select2();
$element.data('select2').destroy();
it breaks select2 in my side
I get error 'select2' ('destroy') when changing route edit how fix it.