Deletion in EasyUI is very simple, usually just copy and paste.
Below is the deletion of the tree node.
The code copy 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 children below
showmsg = "There may be details below the project, can I delete them together?";
} else {
showmsg = "Do you delete this rule?";
}
parent.$.messager.confirm('tip', 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('tip', data.msg);
else
parent.$.messager.alert('Prompt', "Delete Successfully");
rulesetreegrid.treegrid('remove', rows[0].id);
rulesetreegrid.treegrid('reload', rows[0].pid);
} else {
parent.$.messager.alert('error', data.msg);
}
}
});
}
});
} else {
parent.$.messager.alert('tip', "Please select an item to delete!");
}
}
The above is the entire content of this article, I hope you like it.