You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,11 @@ Here are all the available options:
90
90
<td>If <code>true</code>, remove all Edit JSON buttons from objects.</td>
91
91
<td><code>false</code></td>
92
92
</tr>
93
+
<tr>
94
+
<td>disable_properties</td>
95
+
<td>If <code>true</code>, remove all Edit Properties buttons from objects.</td>
96
+
<td><code>false</code></td>
97
+
</tr>
93
98
<tr>
94
99
<td>form_name_root</td>
95
100
<td>The first part of the `name` attribute of form inputs in the editor. An full example name is `root[person][name]` where "root" is the form_name_root.</td>
@@ -569,6 +574,35 @@ Here's an example of the `table` format:
569
574
}
570
575
```
571
576
577
+
For arrays of enumerated strings, you can also use the `select` or `checkbox` format. These formats require a very specific schema to work:
578
+
579
+
```json
580
+
{
581
+
"type": "array",
582
+
"uniqueItems": true,
583
+
"items": {
584
+
"type": "string",
585
+
"enum": ["value1","value2"]
586
+
}
587
+
}
588
+
```
589
+
590
+
By default, the `checkbox` editor (multiple checkboxes) will be used if there are fewer than 8 enum options. Otherwise, the `select` editor (a multiselect box) will be used.
591
+
592
+
You can override this default by passing in a format:
593
+
594
+
```json
595
+
{
596
+
"type": "array",
597
+
"format": "select",
598
+
"uniqueItems": true,
599
+
"items": {
600
+
"type": "string",
601
+
"enum": ["value1","value2"]
602
+
}
603
+
}
604
+
```
605
+
572
606
#### Objects
573
607
574
608
The default object layout is one child editor per row. The `grid` format will instead put multiple child editors per row.
@@ -593,6 +627,7 @@ Editors can accept options which alter the behavior in some way.
593
627
*`collapsed` - If set to true, the editor will start collapsed (works for objects and arrays)
594
628
*`disable_collapse` - If set to true, the collapse button will be hidden (works for objects and arrays)
595
629
*`disable_edit_json` - If set to true, the Edit JSON button will be hidden (works for objects)
630
+
*`disable_properties` - If set to true, the Edit Properties button will be hidden (works for objects)
596
631
*`hidden` - If set to true, the editor will not appear in the UI (works for all types)
0 commit comments