Forum
19:03
01/09/2008
I noticed a difference in the json format that jqgrid uses and the one I see (and have used) as an example at the "official" json site:
http://www.json.org/example.html
The difference is subtle but important. In "standard" json the format is something like:
{"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }}
In jqgrid you expect:
{menu: { id: "file", value: "File", popup: { menuitem: [ {value: "New", onclick: "CreateNewDoc()"}, {value: "Open", onclick: "OpenDoc()"}, {value: "Close", onclick: "CloseDoc()"} ] } }}
In this case, jqgrid doesn't have quotes around the lefthand argument.
That causes me problems because I use flexjson in my java code to properly
format my java POJO's into a json string and the format that jqgrid uses is
not the same as the "standard" json.
Perhaps a parameter in the jsonReader setting to tell the reader to expect
quotes around the left hand arguments and some code to handle it would be
a good idea. Something like "jsonQuoted: true" in the jsonreader. If I was
more familiar with Javascript I might be able to make the change myself. It
*would* make it "json standards" compliant I think.
Just a suggestion
04:19
Moderators
30/10/2007
Hello,
Do you have checked the *standart* way?
I think it shouldl work, since after getting the json data I make a standart
javascript eval on the request which bring you to what you want.
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.
17:12
01/09/2008
Tony,
I thought I had tested this a few times and all I can think of is that I had a syntax problem that was the cause, not the quoted string problem.
So, I have re-tested the application with a "standard" json format and it seems to work just fine so I will go back to using flexjson again.
Sorry about that! My apologies for not checking my assumptions.
Pete
Most Users Ever Online: 715
Currently Online:
56 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