json-editor icon indicating copy to clipboard operation
json-editor copied to clipboard

select2 disable ignored and weird formatting problem with array

Open joshco opened this issue 7 years ago • 4 comments

joshco avatar Dec 28 '16 20:12 joshco

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? image

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"
                ]
              }

            },

joshco avatar Dec 28 '16 20:12 joshco

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.

germanmendoza avatar Jun 20 '17 15:06 germanmendoza

@joshco did you ever find a way to disable select2?

bobbotron avatar Oct 04 '17 17:10 bobbotron

This seems to work. Add it before constructing the JSONEditor widget.

JSONEditor.defaults.editors.select.prototype.setupSelect2 = function () { return true; }

siipikarja avatar May 24 '21 18:05 siipikarja