jqGrid edited row id needs to be refreshed after save from id returned in response.
I tried code below but undefined message box appears.
How to update row id ?
How to get response text after row is updated by Save action button ?
Andrus
grid.jqGrid({
colModel: [{name:_actions,width:45,
formatter:"actions",
formatoptions:
{keys:true,
delbutton:false,
onSuccess:function (rowID, response) {
alert(response);
$("#" + rowID).attr("id", response.responseText);
},
onEdit: function (rowID) {
if (typeof (lastSelectedRow) !== 'undefined' && rowID !== lastSelectedRow)
cancelEditing($('#grid'));
lastSelectedRow = rowID;
}
}}
I don’t want to go back to our old discussion, but I just want to remind that the changing of
idis not good practice.You can try to solve the problem by placing of
$("#" + rowID).attr("id", response.responseText);inside of setTimeout. In the case the changing will be done after processing of the old id in inline editing code.Moreover you could verify the following. In can be important to rename
idin some other places saved by jqGrid internally. For example,selrowandselarrrowwhere the ids of selected rows will be hold.