json-editor
json-editor copied to clipboard
select2 disable ignored and weird formatting problem with array
I have select2 disabled via: JSONEditor.plugins.selectize.enable = false; JSONEditor.plugins.select2.enable = false;
But it still shows as select2 (and my JS doesnt automatically select2 things) Formatting-wise, why does the select2-ified select span beyond the grid?
The relevant JSON schema is
{
"type": "object",
"title": "Slotted",
"properties": {
"entityType": {
"type": "string",
"required": true,
"enum": [
"slotted"
],
"options": {
"hidden": true
}
},
"start_date": {
"type": "string",
"required": true,
"format" : "date"
},
"end_date": {
"type": "string",
"required": true,
"format" : "date"
},
"status":{
"type" : "string",
"required" : true,
"enum" : [
"Invited",
"Scheduled",
"Confirmed",
"Completed"
]
}
},
I had a similar issue. I did want to use select2, but the select was spanning beyond the grid. I solved it using:
JSONEditor.plugins.select2.width = "100%";
Hope it may help someone.
@joshco did you ever find a way to disable select2?
This seems to work. Add it before constructing the JSONEditor widget.
JSONEditor.defaults.editors.select.prototype.setupSelect2 = function () { return true; }