这是我的代码
function customMenu(node) {
var items = {
"create": null,
"rename": null,
"remove": null,
"ccp": null,
"menu_delete": {
"label": "删除",
"icon": "../../img/delete.png",
"action": function(obj) {
//alert(obj.attr("rel"));
var id = obj.attr("id");
if (id == "1") {
alert("根节点不能删除")
return false;
}
if (id && confirm("确定删除吗?")) {
jQuery.ajax({
url: "AjaxService.ashx",
cache: false,
data: {
CommandName: "DeleteClassByID",
id: id
},
success: function(data) {
// alert("ok");
$("#class_tree").jstree("remove", null); }
}); }
}
}
}
}
function customMenu(node) {
var items = {
"create": null,
"rename": null,
"remove": null,
"ccp": null,
"menu_delete": {
"label": "删除",
"icon": "../../img/delete.png",
"action": function(obj) {
//alert(obj.attr("rel"));
var id = obj.attr("id");
if (id == "1") {
alert("根节点不能删除")
return false;
}
if (id && confirm("确定删除吗?")) {
jQuery.ajax({
url: "AjaxService.ashx",
cache: false,
data: {
CommandName: "DeleteClassByID",
id: id
},
success: function(data) {
// alert("ok");
$("#class_tree").jstree("remove", null); }
}); }
}
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货