Unfortunately it seems that the code for addRow
always sets the new row to edit mode:
addRow : function ( p ) {
...
if(p.useFormatter) {
$("#"+$.jgrid.jqID(p.rowID)+
" .ui-inline-edit",
"#"+$.jgrid.jqID($t.p.id)).click();
} else {
var opers = $t.p.prmNames,
oper = opers.oper;
p.addRowParams.extraparam[oper] = opers.addoper;
$($t).jqGrid('editRow', p.rowID, p.addRowParams);
$($t).jqGrid('setSelection', p.rowID);
}
But the good news is that, you should be able to use saveRow
to get the row out of edit mode. Just make sure you pass a unique row ID for the new row so that you are able to reference it in the next call:
jQuery("#energy").jqGrid('addRow', {rowID: myNewRowID});
jQuery("#energy").jqGrid('saveRow', myNewRowID);
If you have problems with saveRow
, you can also try restoreRow
.
Does that help?