我在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。你能帮我辨认一下我在这里缺少什么吗?