开发者

Jstree with json data type

开发者 https://www.devze.com 2023-02-06 06:35 出处:网络
i have used jstree to populate a tree view using json object . my json object is 开发者_Go百科something like this :-

i have used jstree to populate a tree view using json object . my json object is 开发者_Go百科something like this :-

[
 {
  "attr" : { "id" : "li.node.id" ,"rel" : "root"},
  "data":"3-Test Group3","state": "open",
  "children":["4-testing4"]
 },
 {
  "attr" : { "id" : "li.node.id" ,"rel" : "root"},
  "data":"2-Test Group2","state": "open",
  "children":["4-testing4"]
 }
]

This populates a tree but when i used cookie plugin to reselect the selected value i found that child nodes don't have id due to which the plugin does not work.

Can anyone help me how to provide id in child node??

Thanks in advance


how about:

{
"attr" : { "id" : "li.node.id" ,"rel" : "root"},
"data":"3-Test Group3","state": "open",
"children":[ { "data" : "4-testing4", "id" : "some_id" } ]
},
0

精彩评论

暂无评论...
验证码 换一张
取 消