如何在select_node
事件中为 jstree 添加元数据。这就是我试图添加的方式:
$.ajax({
type : 'GET',
url : '/assessment/getassess',
dataType : 'json',
success : function(jsonData) {
$("#treeViewDiv").jstree({
"themes" : {
"theme" : "classic",
"dots" : true,
"icons" : true,
"url" : "/css/themes/classic/style.css"
},
"json_data" : jsonData,
"plugins" : ["themes", "json_data", "ui", "contextmenu"],
"contextmenu" : {
items : createMenu
}
}).bind("select_node.jstree", function(e, data) {
$(data.rslt.obj).data("jstree").description = "Size: 45units";
});
}
});