jqgrid 内联编辑 - 单击 Enter 时保存处理程序
我想知道单击 Enter 保存行时是否有保存方法的事件处理程序。我想用它在保存后隐藏网格中的行。
提前致谢!
Im wondering if there is an event handler for the save method when clicking enter to save the row. I want to use it to hide the row from the grid after being saved.
thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
editRow 和 saveRow 内联编辑方法有您可以使用的
succesfunc
和aftersavefunc
参数。aftersavefunc
的优势不大,因为它可用于本地和远程保存网格数据。所以代码可以在这里查看相应的demo。
您不应该忘记的唯一一件事是,修改的行将被隐藏,但不会被删除,并且该行在下一次网格刷新时可能是可见的。尝试对演示中的行进行排序或转到下一页并返回。如果您远程保存数据并且数据刷新将在服务器端实现,则服务器不应将隐藏行发送到 jqGrid。可能在您的 caee 中使用 delRowData 可能会更好。该方法从本地网格中删除数据,但不向服务器发送删除请求。
Both editRow and saveRow inline editing methods has
succesfunc
andaftersavefunc
parameters which you can use. Theaftersavefunc
has small advantage because it is used in both local and remote holding of the grid data. So the code can beSee the corresponding demo here.
The only thing which you should not forget is that the modified rows will be hidden, but not deleted and the row could be visible on the next grid refresh. Try to sort the rows on the demo or go to the next page and back. If you hold the data remotely and on refreshing of data will be implemented on the server side, the server should just not send the hidden rows to jqGrid. Probably the usage of delRowData could be better in your caee. The method delete the data from the local grid, but send no delete request to the server.