Please post the version of jqGrid and the fork (free jqGrid, Guriddo jqGrid JS or an old jqGrid in version <=4.7), which you use in all your questions about jqGrid.
The callback loadComplete
will be executed after the response is get from the server, the response is parsed, the current page is filled and the other data for the next pages (in case of usage loadonce: true
option) are saved locally too. Thus you should use either beforeProcessing
or loadBeforeSend
or loadError
to access to jqXHR object which is jQuery extension to XMLHttpRequest.
There are different scenarios when you could need to access jqXHR
:
- The callback
loadBeforeSend
can be used for example to set some custom HTTP headers in the request sent to the server. See the answer for the typical code example.
beforeProcessing
can be used to examine the server response and to modifying the data
before there will be processed .
- One want to test whether there are exist pending Ajax request and to abort it for example. Free jqGrid saves the
jqXHR
object of the pending request to internal jqXhr
parameter. One can use abortAjaxRequest
method to abort it. The internal jqXhr
parameter will be cleared (set to null
) directly at the beginning of success
processing.
If I understand your question correctly, then you can use jqXhr
parameter directly after sending the Ajax request to the server. I'm developer of free jqGrid fork, thus I can recommend it to you. The current version of free jqGrid is 4.11.1. You can test it by modifying URLs of jqGrid to the URLs described in the wiki article.