7552
Views
9
Comments
[Select2] TypeError: $select.select2 is not a function
Question
Select2
Web icon
Forge asset by Eduardo Luís
I double checked my code and the example but i'm getting the error in browser inspector "TypeError: $select.select2 is not a function".
I'm using a normal multiselect.
UserImage.jpg
Eduardo Luís
Hello,

i'm going to need a litlle bit more information, what jQuery version are you using? what browser? can you share the eSpace?
2018-10-18 22-42-41
José Ventura
Staff
Hi Eduardo,

jQuery version: 1.8.3
Platform server: 9.0.1.5
Error in Chrome and Firefox, didn't tried on IE.
The multiple-select it's inside a webblock (like the example) and is consumed from other eSpace.
I'll try to reproduce the error in a new and clean eSpace to attach it here.

Thank on advance
UserImage.jpg
Eduardo Luís
Ok, i'll be waiting.

Meawhile, what settings are you using, if any?
2018-10-18 22-42-41
José Ventura
Staff
Hi Eduardo,

I'm not passing any properties.
eSpace Attached.
The Multiple Select is not converted into Select2 :(


TB_Test_Select2.oml
UserImage.jpg
Eduardo Luís
Weird, i just publish your eSpace in my cloud and it works fine (see the link).
This only appens with a multi select? Have you try with a standard select? And the examples page, it's working?
2018-10-18 22-42-41
José Ventura
Staff
Well, it's working... now it was a problem created by my attempts to get it to work. I tried to change the JS inside Select2 and that's why it wasn't working in the example above. I replaced it with the original Select2 eSpace and started to work.
Now I'll try to place the multiselect inside a container with the layout of the original application and see if it works.
2018-10-18 22-42-41
José Ventura
Staff
I put the web-block inside my app and doesn't worked.
I dont know if have anything to do with it but I have a built theme with a link to bootstrap css/js. Any JS conflict?



Well I was trying to use Select2 because I'm having a problem with "Chosen" Hidden Overflow inside a ExpandCollapse  container, and see if it would solve my problem... I have to get back to solve the "Chosen" problem and then I'll test Select2 again in another cenario.

Thanks for your help.
UserImage.jpg
Eduardo Luís
Well, a JS conflict would be my bet... i'll search in select2 community to see if something pops out.

Have you tried Silk UI Framework? It comes with a simpler (and older) version of select2. Maybe it's enought to solve your problem...


2018-11-06 14-26-44
Suraj Borade

I have used select2 widget in web block and using that web block in page and I am getting an error in browser that select2 is not a function.

how to resolve this?

Thanks and Regards,

Suraj Borade

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.