Hi,
I'm not entirely sure whether this is a jQuery issue or a jqGrid issue, but we are using the jqGrid to display our grids, and easily enable sorting and filtering. THis works great.
Our server howvever is designed to wrap ALL result into an array of generic information that should always be returned to the client (such as fields we want to keep up to date, status of the server, or just error messages), and put the actual data to be turned into the $array["data"] prior to json_encode it and sending it to the server.
This means I would like to do pre-processing of any serverreturned json befor sending it to the data handler such as the jqGrid.
Someone on the forum (thanks so much), pointed me towards setting the option "datafilter" as follows:
- jQuery(document).ready(function(){
- // Set default AJAX options...
- jQuery.ajaxSetup({
- datafilter: function(data, dataType) {
console.log("Pre-processing data...");
- return data;
- }
- });
- });
Unfortunately, I get no console.logs whatsoever when the grid is refreshing its data through ajax...
Does anybody have any idea what might be causing this?
Thanks so much for any ideas/suggestions!