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" } ]
},
精彩评论