You use variable grid inside of errorfunc implementation (grid.restoreAfterErorr). The grid
is undefined and you have exception in the line.
UPDATED: ou should replace alert(response.responseText); to
$.jgrid.info_dialog($.jgrid.errors.errcap,'<div class="ui-state-error">'+
response.responseText +'</div>', $.jgrid.edit.bClose,{buttonalign:'right'});
to see the same styled dialog box as in the standard case. The errorfunc from the inline editing is responsible to display the error message itself.