在jqGrid中,我是否必须手动调用saveRow来触发ajax保存请求? [英] In jqGrid do I have to manually call saveRow to trigger an ajax save request?

查看:561
本文介绍了在jqGrid中,我是否必须手动调用saveRow来触发ajax保存请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里的文档不是很清楚:

The documentation here is not very clear:

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing&s [] = editurl#saverow

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing&s[]=editurl#saverow

在用户完成对表格单元格/行的编辑之后,我是否必须手动进行saveRow调用,还是当行(单元格)失去焦点时jqGrid会自动触发saveRow吗?

Do I have to manually make a saveRow call after the user finishes editing a table cell/row, or will jqGrid automatically trigger saveRow when the row (cell?) loses focus?

在初始设置中,我给jqGrid一个editurl值,但是当我完成一行编辑后,我看不到任何ajax请求发出.

I'm giving jqGrid a editurl value in the initial setup, but I don't see any ajax requests going out when I finish editing a row.

推荐答案

您有两个选择:

  1. 您将 editRow 与参数.如果方法 saveRow 将被调用,用户按 Enter 和方法 restoreRow <如果用户按 Esc ,将调用/a>.如果您不需要致电 saveRow 明确地.在 onSelectRow 内部,通常会调用 saveRow 代替 restoreRow .trirand.com/jqgridwiki/doku.php?id = wiki:events#events"rel =" noreferrer> onSelectRow 回调.另外(或替代),您可以为用户提供保存当前编辑行的界面.可以是某种保存"按钮.
  1. You use editRow with the parameter keys: true. In the case the method saveRow will be called if the user press Enter and the method restoreRow will be called if the user press Esc. In the case you don't need to call saveRow explicitly. Inside of onSelectRow one calls typically restoreRow see here an example.
  2. You can call saveRow instead of restoreRow in the onSelectRow callback. Additionally (or alternatively) you can gives the user an interface to save current editing row. It can be some kind of "Save" button.

这篇关于在jqGrid中,我是否必须手动调用saveRow来触发ajax保存请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆