Jqgrid在内联编辑上更改值 [英] Jqgrid Change values on inline edit

查看:117
本文介绍了Jqgrid在内联编辑上更改值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上只有一个网格,例如当它进入内联编辑模式时,一旦用户填写了第一个网格,我想填写一些字段(基于价格的字段)他们输入了50的价格,我想更新nett和Gross字段.

I have got a single grid on my page, and when it drops into inline edit mode there are some fields i would like to fill in (price based ones) as soon as the user has filled the first one in, for example they put a price of 50 in, i want to update the nett and gross fields.

通常我会使用jquery模糊功能来执行此操作,但是我不确定如何获取网格上输入框的名称,它们似乎是一个数字,具体取决于行,然后是字段名称

Normally i would do this using a jquery blur function, but i'm not sure how to get the names of the input boxes on the grid, they seem to be a number depending on the row, then the name of the field.

谢谢 卢克

推荐答案

通常,您需要在用户修改单元格值一次后使用

Typically is you need update the cell after the user modified the cell value one use cell editing mode. In case of usage inline editing mode for row editing you have some options:

  • you initialize inline editing with keys: true parameter and the row will be saved after the user press Enter key. The user can any time discard the changes by pressing Esc key.
  • you provide some button which the user can click to save the changes. You can use formatter: 'actions', inlineNav or your custom button to do this.
  • You can implement saving of current editing row inside of onSelectRow or some other callback.

以任何方式,内联编辑模式中的标准方法都是对行进行操作,而无需基于单元格进行其他操作.如果确实需要将blurfocusout事件绑定到编辑行的所有输入字段,则可以将dataEventstype: 'blur'(或type: 'focusout')结合使用.为了轻松定义所有列的编辑选项,您可以使用jqGrid的cmTemplate选项(请参见此处).

In any way the standard way in inline editing mode is working with rows without additional actions on cell basis. If you do need to bind blur or focusout event to all input fields of editing row you can use dataEvents with type: 'blur' (or type: 'focusout'). To easy define the editoptions for all columns you can use cmTemplate option of jqGrid (see here).

这篇关于Jqgrid在内联编辑上更改值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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