This article introduces you to the Easyui tree node (treegrid node) of the deletion method and examples, here recommended to everyone, I hope to help you.
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.
The code is 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 = "Under the item may have the rule, whether also delete 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 (' Prompt ', "Please select an item to be deleted!");
}
}
The above mentioned is the entire content of this article, I hope you can enjoy.