Hi,
Im using jstree and a modal with select2 dropdown, and whenever i load the jstree.bundle.js select2 gets an error "select2 is not a function". I'm using the plugins.bundle.js which contains the select2 function which is above the jstree.bundle.js. What can i do to fix this?
Both jstree and select2 depend on jQuery, and if jQuery is reloaded or overwritten, it can break select2. Try checking the console for errors related to jQuery.
sprunki retake
Make sure that the JavaScript file containing Select2 (select2.js or plugins.bundle.js in your case) is loaded smash karts before the jstree.bundle.js file. The order of loading is important, otherwise Select2 will not be defined before you try to use it.
Hi,
In our build, it seems JSTree works fine. You can check it here. Please note that Select2 is globally included in the plugins.bundle.js.
May I know your Metronic version?
Regards.
Hi thanks for the reply, is there an example where jstree and select2 are on the same page? It seems that whenever i load jstree.bundle.js select2 does not work.
Hi,
I just tested Select2 with jStree with the latest Metronic 8.3.2 and it worked well:
<img src="https://i.imgur.com/7KTXGRE.png" alt="">
Please make sure that you include assets/plugins/custom/jstree/jstree.bundle.js
after the assets/plugins/global/plugins.bundle.js
.
Regards,
Sean
Hi,
I am using metronic version 8.1.8 and facing with same problem, do you have any suggestion?