I am trying to inject inline insertion into JQGrid. So far my approach is:
- Use
addRowData to put an empty string at the end with ID = -1 - Use
editGridRow to edit this row. - Determine on the server that this update is actually an insertion since ID = -1 and returns a new ID value
Surprisingly, this rube goldberg circuit works very well. However, to make it seamless, I would like to quietly update the identifier of the row just added so that the user can continue to edit other columns. I would rather not do grid.trigger("reloadGrid") because I am losing focus on this row.
I tried
grid.setRowData(-1, { MyPrimaryKeyField: newID });
but this does not work (he still considers the row id to be -1). Is there an easy way to change the primary row id without reloading the entire grid?
jqgrid
Herb caudill
source share