Javascript:在jstree中动态添加节点

时间:2012-07-31 09:52:54

标签: javascript jstree

如何在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" ] 
    });
});

0 个答案:

没有答案