Jgrid在按钮上单击保存单元格 [英] Jgrid Save cell on button click

查看:119
本文介绍了Jgrid在按钮上单击保存单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用afterSaveCell,如果我们修改单元格,它将触发它.

I am using afterSaveCell that fires if we modifies the cell then it get fires.

我的情况是,我正在保存更改"按钮上对数据库进行批处理更新.但是,当用户编辑单元格并转到另一个单元格时,我将修改记录在数组中.

My scenario is that i m doing batch update to the database on save change button. But when user edit the cell and got to the other cell then i log the modification in a array.

但是,如果用户编辑单元格并单击保存更改"按钮,则单元格焦点不会丢失(仍处于编辑模式),并且不会触发afterSaveCell.

But if user edit the cell and click on the Save Change button the cell focus not get lost (Still in edit mode) and afterSaveCell not get fired.

有什么方法可以触发将单元格保存到按钮上,从而使afterSaveCell触发.

IS there any way to fire the Save the cell on buttojn click so that afterSaveCell get fires.

请帮忙. 谢谢.

推荐答案

您可以致电 saveCell 方法.此方法具有iRowiCol作为参数.要了解当前可编辑单元格的此参数,可以添加 afterEditCell 到网格.因此,您将iRowiCol的最后一个值保存在jqGrid之外的变量中,并在保存更改"按钮上的on click事件中使用它,在其中调用

You can call saveCell method. This method has iRow and iCol as a parameters. To know the this parameters for the current editable cell you can add afterEditCell to the grid. So you save last values of iRow and iCol in a variable outside of jqGrid and use there inside of on click event on "Save Change" button where you call saveCell with these parameters.

这篇关于Jgrid在按钮上单击保存单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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