I have a grid with a pager. I need to stop the pager from loading another page while on the current page a row is in inline edit. So when i create the grid i define the onPaging function
....
onPaging : function(){
if (inEdit()>0){
alert("Finish editing the current line");
return 'stop';
}
}
....
the function inEdit simply counts how many lines have the attr editable.
This does the job, however later when i call the restoreRow function on the row that was in edit when the paging was stoped the function fails to restore the row to the previous state.
Later Edit:
The problem occurs later when this function is called to cancel the edit
function cancelEdit(id){
/*this line does nothing at all --> */ $('#list').jqGrid('restoreRow',id);
//The only way restore worked is by calling a grid reload but that is not really a solution
$('#list').trigger("reloadGrid", [{page:$('#list')[0].p.page}]);
$('#'+id+' [name=editButton]').show();
$('#'+id+' [name=submitButton]').hide();
$('#'+id+' [name=cancelButton]').hide();
}
PS: The Edit/Save/Cancel/Delete are custom buttons