Discussion on deletion of Treegrid node in Easyui

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.