相关疑难解决方法(0)

如何从Kendo Grid中删除一行

我有一个非常简单的设置,一个名为#list的网格,其中一个数据源填充了要显示的记录.

我在每一行都有一个按钮,其中有一个调用此函数的onClick事件:

    // Soft-Delete person
    var processURL = crudServiceBaseUrl + '?method=deletePerson';
    function deletePerson(id){
        if (confirm('#getResource("person.detail.confirmdel")#')) {
            $.ajax({
                type: 'POST',
                url: processURL,
                data: {
                    PERS_KY: id
                },
                success: function (data){
                    var thingToDelete = "tr:eq("+id+")";
                    var grid = $("#list").data("kendoGrid");
                    grid.removeRow(thingToDelete);
                },
                error: function (xhr, textStatus, errorThrown){
                    alert("Error while deleting person"+ "\n"+ xhr + "\n"+ textStatus + "\n" + errorThrown);
                }
            });
        }
    }

The server-side stuff works fine, the interaction with the database is good. However, the row does not disappear from …
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery kendo-ui

4
推荐指数
2
解决办法
3万
查看次数

标签 统计

ajax ×1

javascript ×1

jquery ×1

kendo-ui ×1