Hello,
I am attempting to add a tree view using the Select2 plugin, and I have tried using the following plugin:
https://github.com/clivezhg/select2-to-tree
While this method works fine on a simple page, I am encountering an error when using it with metronic. The error message is as follows:
Uncaught TypeError: Cannot read properties of null (reading "trim")
at Utils.copyNonInternalCssClasses (plugins.bundle.js:14111:50)
at SelectionCSS.render (plugins.bundle.js:15579:13)
at DecoratedClass.render (plugins.bundle.js:13872:32)
at new Select2 (plugins.bundle.js:18830:38)
at HTMLSelectElement.<anonymous> (plugins.bundle.js:19737:26)
at Function.each (plugins.bundle.js:385:19)
at jQuery.fn.init.each (plugins.bundle.js:207:17)
at $.fn.select2 (plugins.bundle.js:19734:14)
at $.fn.select2ToTree (select2totree.js:41:21)
at (index):798:21
Hi,
Have you tried this plugin with the latest version of Select2?
Could you please provide the code used with Metronic using https://gist.github.com/ ? How did you integrate it with Metronic build? Using gulp or webpack? This Select2 Tree plugin looks not updated for the last 2 years and most probably is not compatible with the latest Select2 version.
Regards.