Search code examples
jqgridjqgrid-formatterjqgrid-inlinenav

How to persist data when edit fails in jqgrid


I perform jqgrid edit via formatter actions. And when the edit validations fails in server and I display the errors to user, I want to remain in the edit mode and save the user entered data. Is it possible. Please help.


Solution

  • You should use restoreAfterError: false option of inline editing. I recommend you to set the option by changing defaults of inline editing:

    $.extend($.jgrid.inlineEdit, {
        restoreAfterError: false
    });
    

    Alternatively you can set restoreAfterError in formatoptions:

    formatter: "actions", formatoptions: {restoreAfterError: false, keys: true, ...}