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
Set a callback function to be invoked when a node is expanded/collapsed (not programtically via APIs). Only applicable when option `mode` is `tree`, `form`, or `view`.
104
+
105
+
The callback is invoked with an object containing `path`, `isExpand` and `recursive`:
106
+
107
+
```
108
+
{
109
+
path: string[],
110
+
isExpand: boolean,
111
+
recursive: boolean
112
+
}
113
+
```
114
+
101
115
-`{function} onEditable({ path, field, value })`
102
116
103
117
Set a callback function to determine whether individual nodes are editable or read-only. Only applicable when option `mode` is `tree`, `text`, or `code`.
@@ -679,6 +693,24 @@ Destroy the editor. Clean up DOM, event listeners, and web workers.
679
693
680
694
Expand all fields. Only applicable for mode 'tree', 'view', and 'form'.
681
695
696
+
#### `JSONEditor.expand(options)`
697
+
698
+
Expand/collapse a given JSON node. Only applicable for mode 'tree', 'view' and 'form'.
699
+
700
+
*`options` fields:*
701
+
702
+
-`{Array.<String>} path`
703
+
704
+
Path for the node to expand/collapse
705
+
706
+
-`{Boolean} isExpand`
707
+
708
+
Whether to expand the node (else collapse)
709
+
710
+
-`{Boolean} recursive`
711
+
712
+
Whether to expand/collapse child nodes recursively
0 commit comments