jsTree:是否可以将JSON映射提供给树(而不是JSON数组)?

时间:2019-01-30 22:35:47

标签: javascript jstree

jsTree插件能否接受JSON对象的映射作为对树的输入?

我们知道jsTree requires the following format of JSON input

[
 { "id" : "01", "parent" : "#", "node1" : "Simple node" },
 { "id" : "02", "parent" : "#", "node2" : "node 2" }
]

但是可以将JSON映射提供给树:

[
 "01": { "id" : "01", "parent" : "#", "node1" : "Simple node" },
 "02": { "id" : "02", "parent" : "#", "node2" : "node 2" }
]

其中键是节点ID?

0 个答案:

没有答案