금요일, 12월 23, 2016

Change row id of jqGrid.

aftersavefunc: function(rowID, response) {
var row = matrixTable.jqGrid('getLocalRow', rowID);
var newID = response.responseJSON.id;
row._id_ = newID;

matrixTable.jqGrid('setRowData', rowID, {id:newID});
$("tr[id='" + rowID +"']").attr("id", newID);

var _index = matrixTable.jqGrid('getGridParam', '_index');
var valueTemp = _index[rowID];
delete _index[rowID];
_index[newID] = valueTemp;

}