如何检索jstree的属性(使用JSON构建)?

时间:2013-09-18 00:31:32

标签: javascript jquery

我在jstree中选定节点的属性遇到困难。以下是我实现jstree的方法:

 $(function () {
 $("#tree").jstree({ 
"json_data" : {
    "data" : [
        { 
            data : "/", 
            attr : { "id" : "root" , "value" : "alpha"},
            state : "closed",
            "children" : [ { "data" : "child1",
                            "attr" : { "id" : "child1.id" },
                            "children" : [ ] }
                         ]
        },
    ]
},
"plugins" : [ "themes", "json_data", "crrm", "ui" ]
})
.bind("select_node.jstree",function(event, data) { . . . }

根据我的研究,我发现data.rslt.obj.attr(“value”)应返回“value”属性的值,但每次都返回undefined。你能帮我辨认一下我在这里缺少什么吗?

0 个答案:

没有答案
相关问题