Afternoon,
On a website I already updated lots of elements that used select2 v. 3.5.2 to the new v. 4.0 (and some of those elements are on the header of the website that is present on ALL pages)
Unfortunately on some pages of the website the X-editable jquery plugin is used, and that plugin doesn't play well with v 4.0 of select2 (please read: does not play at all)
My question is: Can I use both versions of select2 on some pages?
And if so, how? Since $(...).select2(); is blind to which version of select2 is loaded....
Example code:
$("#search_species").select2({
minimumInputLength: 1,
maximumSelectionSize: 1,
ajax: {
url: "/php/search.php",
dataType: 'json',
delay: 250,
data: function (params) {
return {
query: params.term
};
},
processResults: function (data, params) {
return { results: data };
},
cache: true
},
escapeMarkup: function (markup) { return markup; },k
templateResult: formatarResultados,
templateSelection: formatarSeleccao,
}).on("select2:selecting", function(e) {
console.log(e);
// window.location.href = e.params.args.data.url;
// $('.select2-drop').hide();
});