var newRow = {};
var dynamicId = Math.floor(Math.random() * 10) - 100;
newRow.Id = dynamicId;
newRow.Deprecated = false;
newRow.IsTemplate = false;
newRow.Exclude = false;
//newRow.pq_rowcls = 'yellow';
$grid.pqGrid("addRow", { rowData: newRow, rowIndxPage: 0, checkEditable: false, history: false });
$grid.pqGrid("setSelection", null);
$grid.pqGrid("setSelection", { rowIndxPage: 0, dataIndx: 'EventName' });
$grid.pqgrid("editFirstCellInRow", { rowIndxPage: 0 });
Id is primary key set in dataModel.
When new row is added, the cells become dirty (red sign showing in upper left corner) and get added in updatelist and addlist. On ajax success call the response has addlist with new Id but it is not getting updated.
grid.commit({ type: 'add', rows: jsonRsp.addList });
grid.commit({ type: 'update', rows: jsonRsp.updateList });
grid.commit({ type: 'delete', rows: jsonRsp.deleteList });
I am not sure what I am doing wrong?