jdorn / json-editor

JSON Schema Based Editor
MIT License
5.81k stars 1.08k forks source link

Multiple Checkboxes #348

Open Orsjaxir opened 9 years ago

Orsjaxir commented 9 years ago

How to enable an area containing multiple checkboxes, of which any combination of them may be selected simultaneously? (As opposed to only one of them being able to be selected at a time?)

We've got it functional using ComboBoxes with true/false in the dropdown menu, but checkboxes would be preferable for our app's UI. Are we just missing a configuration option?

jdorn commented 9 years ago

Multiple checkboxes are used automatically for arrays of unique enumerated strings. Any schema matching this format should work:

{
  "type": "array",
  "uniqueItems": true,
  "items": {
    "type": "string",
    "enum": ["value1","value2"]
  }
}

There's more documentation for this at https://github.com/jdorn/json-editor#arrays