Home php教程 PHP开发 A brief discussion on deletion of Treegrid nodes in EasyUI

A brief discussion on deletion of Treegrid nodes in EasyUI

Dec 29, 2016 pm 01:51 PM

Deleting in EasyUI is very simple, usually just copy and paste.

The following is the deletion of tree nodes.

// 删除
function removes() {
    var rows = ruletreegrid.treegrid('getSelections');
    if (rows && rows.length == 1) {
        var showmsg = "";
        if (rows[0].pid == 0) {
            // 下面有子节点
            showmsg = "项目下面可能存在细则,是否也一起删除 ?";
        } else {
            showmsg = "是否删除此细则 ?";
        }
        parent.$.messager.confirm('提示', 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('提示', data.msg);
                            else
                                parent.$.messager.alert('提示', "删除成功");
                            ruletreegrid.treegrid('remove', rows[0].id);
                            ruletreegrid.treegrid('reload', rows[0].pid);
                        } else {
                            parent.$.messager.alert('错误', data.msg);
                        }
                    }
                });
            }
        });
    } else {
        parent.$.messager.alert('提示', "请选择一条要删除的项目!");
    }
}
Copy after login

The above is the entire content of this article, I hope you all like it.

For more articles related to the deletion of Treegrid nodes in EasyUI, please pay attention to the PHP Chinese website!


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1672
14
PHP Tutorial
1277
29
C# Tutorial
1257
24