Forum
02:45
23/01/2010
Hi,
I had a working site, then updated to version 3.6.5. (Also updated JQuery to 1.4.2 and JQueryUI to 1.8.1.)
Now, when I load my grid, the 'loadError' event triggers, and I get:
status "parsererror"
error "Invalid JSON: {records:4558,total:456,page:1,rows:[{id:'45600',cell:['1','56453'....."
(Contents of the JSON are excluded, as it is too big, and confidential...)
When monitoring the response using Fiddler with a JSON inspector, I can see that the JSON is valid...
As a test, I simply replaced the 3.6.4 version of JQGrid and it worked fine!
Please advise!
Glen
09:13
Moderators
30/10/2007
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
09:47
23/01/2010
Thanks... this will help a lot.
More questions:
1) Please confirm: the JSON used in coding and the JSON used in the data work must be formatted differently?
2) Could you also elaborate on what this is referring to: "the so named “d” property from the response (used in certain systems)."
What 'certain systems' is this referring to? If I have complete control over the JSON sent to the browser, do I have to worry about this?
3) "With version 3.6.5 we switch from ajax complete to ajax success event" --> Does this have any impact on my coding, especially in the handlers for 'loaderror', 'loadcomplete', etc. ?
4) This change to how JSON data is processed was not mentioned in the 'jqGrid 3.6.5 changes and fixes', yet is a major breaking change. I would expect that most current implementation will break when converting. Are there other changes that we should be aware of?
Thanks,
Glen
09:56
Moderators
30/10/2007
Hello,
This is a needed change.
You will get the same error if you use jQuery 1.4 and use getJSON - just try - more info you can find here:
http://api.jquery.com/jQuery.getJSON/
See Important notes.
The d property is used in some Microsoft Systems.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
10:07
23/01/2010
For the record, in case others wonder about this...
From the JQuery site linked by Tony:
JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes.
I was not clear on the difference between the 'object literal notation' and 'JSON'... I thought they were the same thing, but see now that they are similar, but different.
And, as per the www.json.org web site, all strings must be quoted, but values such as numbers and booleans should not be quoted.
Thanks Tony!
19:49
23/01/2010
Another entry, to help others...
I had this line in my .jqGrid() initializer:
loadComplete: function(response) {
ShowInfo(jQuery.jgrid.parse(response.responseText));
},
Now, with version 3.6.5, I no longer have to parse the response, since it is already a Javascript object:
loadComplete: function(response) {
ShowInfo(response));
},
09:35
Moderators
30/10/2007
Hello,
Thanks for this. We should add it to the documentation.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
18:18
27/09/2012
tony said:
Hello,
This is a needed change.
You will get the same error if you use jQuery 1.4 and use getJSON - just try - more info you can find here:
http://api.jquery.com/jQuery.getJSON/
See Important notes.
The d property is used in some Microsoft Systems.
Regards
Tony
this url no working 😉
Most Users Ever Online: 715
Currently Online:
54 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66