Cannot get select2 working in Editor
Cannot get select2 working in Editor
Lucho_1312
Posts: 30Questions: 9Answers: 0
Hi!
I'm making some tests with the editor, so I've been trying a lot of time to use Select2 plugin, but I can't make it work. I always get this error:
dataTables.editor.js:109: Uncaught TypeError: Cannot read property 'create' of undefined
I'm setting the field like this:
{
label: "Brand",
data: "brand",
name: "brand",
type: "select2",
"opts": {
"ajax": {
"type": "GET",
"url": "/api/v1/cars/brands",
"dataType": "json",
"cache": true
}
}
}
Also, i'm including both select2 files:
/select2/select2.css
/select2/select2.js
Am I missing any file?
Thanks!
Luciano
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You need to also include the Select2 field plug-in for Editor as it is not a built in field type.
Allan
Oh, so I see now that the problem is that I can't see the plugin download link as I'm in trial now :(
As that didn't work, I'm tried to make my own plugin, because I need editor for some tests agains a node js app.
This is what I have until now (not working well yet because it doesn't initializates when I click it in the inline editing, but if I finish it I can use it for my test to see if I'll use editor or not)
I left it here, maybe it's useful for someone else or someone have an idea to finish it.
Thanks!
Luciano