I am using jqGrid to display the results of a database query. A php script that executes the request and then formats the results as XML for jqGrid consumption also does some error checking. (For example, he can confirm the dates to make sure that they are in the correct format and that the start date is before the end date.) Such errors are formatted in XML, but in contrast to a successful request.
What I want to do is intercept the result of the ajax call and process it differently depending on whether the result contains one of these user errors. If there is no error, then I want to load the result into jqGrid. If there is an error, I would simply display on a page without a grid (since the grid is configured for a different number of columns).
I am looking for the right approach to how to proceed (not necessarily the actual code). (My problem is not how to parse the XML response, but how to intercept it so I can parse it.) I was hoping to use jqGrid events like gridComplete or loadComplete, but they seem to fire after the grid is already loaded.
source
share