I am working on my first implementation of a jqGrid. I am using the standard add/edit buttons that appear in the navGrid but am having problems identifying how process the server response when I click Submit in the edit/add forms.
.navGrid("#product-codes-footer",{edit:true,add:true,del:false},
{afterShowForm:afterShowEdit}, {afterShowForm:afterShowAdd} );
Is there a standard callback or event parameter I am missing somewhere regarding this? Is there a way to define how saveRow
is called or is there a default success/error callback method I can implement?
Any direction would be much appreciated!!!
You could try this:
There are a few ways I have seen to do this:
From the documentation:
afterComplete This event fires immediately after all actions and events are completed and the row is inserted or updated in the grid. afterComplete(serverResponse, postdata, formid) where
gridComplete This fires after all the data is loaded into the grid and all other processes are complete.
loadError xhr,st,err A function to be called if the request fails. The function gets passed three arguments: The XMLHttpRequest object (XHR), a string describing the type of error (st) that occurred and an optional exception object (err), if one occurred.
There is a handy/helpful PDF documents (a little dated): http://www.scribd.com/doc/17094846/jqGrid.
There appears to be a couple event parameters that I failed to completely read and comprehend...
API --> http://www.trirand.com/jqgridwiki/doku.php?id=wiki:form_editing#editgridrow
using the event parameters for afterSubmit and afterComplete allow me to process the server response and update the form.
--Dan
EDIT Here is an example of the code used...