【问题标题】:Why doesn't Popup Kendo close when I click on Update?为什么当我点击更新时弹出剑道没有关闭?
【发布时间】:2013-08-11 09:42:38
【问题描述】:

当弹出窗口打开并且我点击更新时,窗口没有关闭

我希望在点击更新时关闭窗口

jsfiddle code

按钮更新代码

save: function (e) {

            $.ajax({

                url: '/api/apdevice',
                type: 'POST',
                contentType: 'application/json',
                data: JSON.stringify(e.model),

                success: function (data) {
                  alert('yes');

                },

                error: function (data) {
                   alert('no');
                }

            });
        }

【问题讨论】:

    标签: popup kendo-ui kendo-grid


    【解决方案1】:

    您需要告诉网格在成功或错误后要做什么。查看grid methods。在这个例子中,我使用了refreshcancelRow

    save: function (e) {
        var that = this;
        $.ajax({
    
            url: '/api/apdevice',
            type: 'POST',
            contentType: 'application/json',
            data: JSON.stringify(e.model),
            success: function (data) {
                alert('yes');
                that.refresh();
            },
    
            error: function (data) {
                alert('no');
                that.cancelRow();
            }
    
        });
    }
    

    这里有一些更新的小提琴:

    【讨论】:

    • 感谢回复,问题已解决。但是更新firefox浏览器后出现错误,TypeError: r is undefined, Chrome browser Uncaught TypeError: Cannot read property 'data' of undefined, 还附上一段视频让我更了解。youtu.be/Ae5u7mFw79A跨度>
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-24
    • 1970-01-01
    • 1970-01-01
    • 2021-01-19
    • 2011-10-13
    • 1970-01-01
    相关资源
    最近更新 更多