javascript - 保存后的 jqGrid 事件不会触发

标签 javascript jqgrid error-handling

我有一些事件是这样设置的:

$('#grid').jqGrid('saveRow', lastsel, 
    { aftersavefunc: function (rowid, response) { alert('after save'); },
    errorfunc: function (rowid, response) { alert('error occured'); } 
});

问题是,他们从不开火!

编辑2

将答案移至实际答案,而不是将其包含在问题中。

最佳答案

好的,问题解决了。您还必须将事件参数添加到“editRow”调用中。它们在保存时使用……真是令人困惑!

$('#grid').jqGrid('editRow', id, { keys: true,  
    aftersavefunc: function (rowid, response) { alert('after save'); }, 
    errorfunc: function (rowid, response) { alert('...we have a problem'); }  
}); 

关于javascript - 保存后的 jqGrid 事件不会触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10210267/

相关文章:

c# - 注释 try catch 语句

javascript - 如何使用纯 JavaScript 获得随页面滚动并在到达顶部导航时粘贴的导航

jquery - jqgrid : pager alignment

c# - 如何在 jqgrid 行单元格中绑定(bind)下拉列表

jquery - 如何设置jqGrid鼠标悬停时的工具提示?

Mysql错误信息:"#1044 - Access denied for user ' root'@'localhost' to database 'information_schema'"当试图删除 TableView

c++ - 使用std::filesystem, error shows cannot convert int to _Valty

javascript - 链接div到firefox中输入文本

javascript - 响应式导航不显示所有元素

javascript - 如何通过导航选项卡使 Google 图表做出响应