如何在jstree中动态添加节点?
您可以选择链接http://www.jstree.com/documentation/crrm。
$(function () {
$("#alarm-treeview").jstree({
"json_data" :
{
"data" :
[
{
"data" : "PI_SERVER1",
"attr" : { "id" : "root.id" },
"children" : [ { "data" : "Alarms",
"attr" : { "id" : "Alarms.id" },
"children" : [ ] },
{ "data" : "Events",
"attr" : { "id" : "Events.id" },
"children" : [ ] }
]
},
]
$("#PI_SERVER1").jstree("create","#phtml_1","first",true);
},
"plugins" : [ "themes", "json_data", "crrm" ]
});
});