jsgrid在ajax成功函数之前删除我的项目

时间:2017-10-07 15:34:30

标签: javascript ajax jsgrid

看起来像我的代码:

onItemDeleting: function (args) {
    $.ajax({
        type: "POST",
        url: "/something/asd",
        data: { asd: "cool something" },
        success: function (data) {
            if (data)
                alert("it is something");
            else {
                args.cancel = true;
                alert("something wrong, dude");
            }
        },
        error: function () {
            args.cancel = true;
        },
        dataType: "json"
    });
}

当ajax执行时,删除已完成。 args.cancel = TRUE;不太有效,因为删除方法已经完成。 我需要一个事件驱动的解决方案,在ajax成功函数之前不执行删除。

0 个答案:

没有答案
相关问题