Deleting in EasyUI is very simple, usually just copy and paste.
The following is the deletion of tree nodes.
// 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 = "There may be details under the project, do you want to delete them too?";
} else {
showmsg = "Delete this rule?";
}
parent.$.messager.confirm('prompt', 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('prompt', data.msg);
else
parent.$.messager.alert('prompt', "Delete successfully");
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 delete!");
}
}
The above is the entire content of this article, I hope you all like it.