The deletion in the Easyui is very simple, generally copy and paste directly on the line.
The following is a deletion of the tree node.
Copy Code code as follows:
Delete
function removes () {
var rows = Ruletreegrid.treegrid (' getselections ');
if (rows && rows.length = 1) {
var showmsg = "";
if (Rows[0].pid = = 0) {
There are child nodes below
ShowMsg = "Item may exist under the rules, is it also deleted together?" ";
} else {
ShowMsg = "Do you want to delete this rule?" ";
}
Parent.$.messager.confirm (' Hint ', showmsg, function (r) {
if (r) {
$.ajax ({
URL: "assess/rule/ruleremoves/" + rows[0].id + ". Do",
DataType: "JSON",
Success:function (data) {
if (data && data.success) {
if (data.msg && data.msg!= "")
Parent.$.messager.alert (' hint ', data.msg);
Else
Parent.$.messager.alert (' Hint ', "delete succeeded");
Ruletreegrid.treegrid (' Remove ', rows[0].id);
Ruletreegrid.treegrid (' Reload ', rows[0].pid);
} else {
Parent.$.messager.alert (' Error ', data.msg);
}
}
});
}
});
} else {
Parent.$.messager.alert (' Hint ', "Please select a item to be deleted!") ");
}
}
The above mentioned is the entire content of this article, I hope you can enjoy.