This is an old revision of the document!
Table of Contents
Upgrade from 3.6.4 to 3.6.5
You should read this upgrade notes when you use JSON response from the server.
With version 3.6.5 we switch from ajax complete to ajax success event. This will reflect in certain systems not to display the data.
What you need to know if the data is not displayed when you upgrade from 3.6.4 to 3.6.5 version
Valid JSON response
Your json response should be correct json formatted string. This mean that if your response look like this:
{ total: "xxx", page: "yyy", records: "zzz", rows : [ {id:"1", cell:["cell11", "cell12", "cell13"]}, {id:"2", cell:["cell21", "cell22", "cell23"]}, ... ] }
This will not work.
In order to display the data in the grid, you should properly define the json response - i.e
{ "total": "xxx", "page": "yyy", "records": "zzz", "rows" : [ {"id" :"1", "cell":["cell11", "cell12", "cell13"]}, {"id" :"2", "cell":["cell21", "cell22", "cell23"]}, ... ] }
As can be seen every property should be quoted.
The "d" Property
Switching from ajax complete to ajax success event causes to skip the jqGrid parse function, which detect automatically the so named “d” property from the response (used in certain systems).
In order to solve the problem the jsonReader should be changed so that it can interpret this property correct.
If the default jsonReader is :
jQuery("#gridid").jqGrid({ ... jsonReader : { root: "rows", page: "page", total: "total", records: "records", repeatitems: true, cell: "cell", id: "id", userdata: "userdata", subgrid: {root:"rows", repeatitems: true, cell:"cell" } }, ... });
It should be changed to
jQuery("#gridid").jqGrid({ ... jsonReader : { root: "d.rows", page: "d.page", total: "d.total", records: "d.records", repeatitems: true, cell: "cell", id: "id", userdata: "userdata", subgrid: {root:"d.rows", repeatitems: true, cell:"cell" } }, ... });
Note that the cell property should not be changed