jqgrid aftersavefunc没有开火(jqgrid aftersavefunc not firing)

编程入门 行业动态 更新时间:2024-10-27 10:31:12
jqgrid aftersavefunc没有开火(jqgrid aftersavefunc not firing)

我正在使用jqgrid 4.8 JavaScript,我正在使用内联编辑和clientArray。 现在,我想更改单元格中的值并保存行,因此代码为:

$("#jqGrid").jqGrid('setCell', rowId, 'comments', 'test'); var saveparameters = { "successfunc": null, "url": 'clientArray', "aftersavefunc": function (rowid, response, options) { alert('b'); }, "extraparam": {}, "errorfunc": null, "afterrestorefunc": null, "restoreAfterError": true, "mtype": "POST" }; $("#jqGrid").jqGrid('saveRow', rowId, saveparameters);

......但警报永远不会发生。 我究竟做错了什么?

I'm using jqgrid 4.8 JavaScript, I'm using inline edit and clientArray. Now, I want to change value in a cell and save row, so the code is:

$("#jqGrid").jqGrid('setCell', rowId, 'comments', 'test'); var saveparameters = { "successfunc": null, "url": 'clientArray', "aftersavefunc": function (rowid, response, options) { alert('b'); }, "extraparam": {}, "errorfunc": null, "afterrestorefunc": null, "restoreAfterError": true, "mtype": "POST" }; $("#jqGrid").jqGrid('saveRow', rowId, saveparameters);

...but the alert never fires. What am I doing wrong?

最满意答案

这只会在您致电时触发:

$('#jqGrid').jqGrid('editRow', rowId, false);

参考:

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing#saverow

this will only fire if you call:

$('#jqGrid').jqGrid('editRow', rowId, false);

Reference:

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing#saverow

更多推荐

本文发布于:2023-08-07 13:07:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464184.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:jqgrid   aftersavefunc   firing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!