正在使用
$("#demo1").jstree({
"xml_data" : {
"ajax" : {
"url" : "phpxml.php",
"data" : function (n) {
return {
"operation" : "get_children",
"id" : n.attr ? n.attr("id").replace("node_","") :1
};
}
}
},
"plugins" : [ "themes", "xml_data" ,"ui","crrm","contextmenu","types"],
"contextmenu" :
{
items:
{
"ccp" : false,
"create" :
{
"label" : "Create",
"action" : function (obj) { this.create(obj); },
"_disabled" : function (obj) { alert("obj=" + obj); return "default" != obj.attr('rel'); }
},
}
},
});
});
答案 0 :(得分:1)
您必须使用:“contextmenu”:{items:customMenu},
customMenu是一个函数。
您可以看到相同的问题:Configuring jstree right-click contextmenu for different node types