search
Homephp教程PHP开发A brief discussion on deletion of Treegrid nodes in EasyUI

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('提示', "请选择一条要删除的项目!");
    }
}

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
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

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools