Search code examples
jqgridform-editing

jqGrid: Custom handling of submit button in edit form?


I am working on form editing in jqGrid. I am using completely local data (array) for populating the grid; no talking to the server for any reason. I have the edit button in the pager, and clicking it brings up the edit form.

  1. Now I need the submit button in the edit form to work in the default way (all validations, showing error messages etc) except it should not try to submit to the server (and end up saying no url is set).

  2. Instead i need to save the edited values (after validation) back to the row and grid. Is that possible?

  3. If not, I suppose I have to add a custom button in the edit form. I tried. But how do I invoke all the custom validation handlers tied with the fields and show the error messages like the default way?

Your help is highly appreciated. Thanks.


Solution

  • jqGrid don't supports local editing in case of usage form editing. Only inline editing and cell editing support local editing. One should just set editurl: "clientArray". So the easiest way to solve all your problems is the usage of inline editing instead of form editing.

    Nevertheless local editing can do be implemented in case of usage form editing. The answer with the demo is modification of the answer and this one. I posted my original answer almost 3 years ago. Because of some modifications in jqGrid the code need be modified a little. The last demo uses the current 4.5.4 version and it works. So you can uses the code to solve your problem.