I’m trying to use inline editing in jqGrid and I’m having trouble with the return values.
If I use the .jqGrid('navGrid'... and set edit:true, I can just attach a function to the afterComplete property. I’ve got that working, but it isn’t exactly what I want.
How do I do it when using inline editing?
I want to use the icons in the navigator to initiate the edit and save. I suppose I could overwrite the default methods to use my own version of .jgrid('editRow'..., but there has to be an easier way.
My other question is this. If I do end up using the editRow call and use the “successfunc” parameter, what do I send back from the editurl page (written in PHP) to indicate a success?
I am not sure that I full understand your question.
To the first part of your question: I recommend you to use inlineNav method instead of navGrid. In the case the buttons added in the navigator will use inline editing.
To you another question: jqGrid use jQuery.ajax internally to communicate with the server. The main indicator for
jQuery.ajaxand so jqGrid whether the server response was successful is HTTP status code. So if the server returns 200 status code (OK) then the response will be interpret as successful. If the server response and code starting with 400jQuery.ajaxcallserrorcallback. So it would be better to useerrorfuncto decode the error response (if needed) and useaftersavefuncto do some actions on successful saving of the row.