开发者

In jqGrid, is it possible to determine which fields have been modified on save?

I'm using jqGrid to display account information to users who administer those accounts, allowing them to modify properties like name, id, and gender for the users they manage. I'd like to warn the user when they modify more than one of these fields.

So, if they modify date of birth and last name at the same time, display a popup that says "are you sure you want to modify these fields?" I already have a custom function which does some validation on the row before saving, but I don't see a built-in function in jqGrid for determining which fields are being modified on save. I can certainly do this my开发者_运维问答self by saving the current values on edit, then comparing to the state of the fields on save, but I'd rather not add additional code if it's not necessary. Is there any easier way that I'm overlooking? Thanks!


The built in methods getCell and getRowData always return the cell content before edit. May be you can try to compare the values with the input elements?

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods

I believe you are using form/inline editing. But if you are using cell editing, there's a getChangedCells method to meet your needs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜