Forum


02:54

30/06/2009

retreivel jqGrid data with json callback
Hi,
jQuery JavaScript Library v1.3.2, jqGrid 3.4.2 - jQuery Grid
I'm trying to retreive jqGrid data with a json callback. But the grid is showing 'Loading...' and firebug detect this error:
the data retreived is :
{
total: "1",
page: "1",
records: "3",
rows :
[
{id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"3",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
]
}
thanks for any help
19:05

30/06/2009

the problem is caused by bad data format.
for jqGrid, json data must to be in a special format :
{
"page":"1",
"total":1,
"records":"3",
"rows":[
{"id":"1","cell":["1","2009-06-15","CLI-1","75000","5000","80000","cli-1"]},
{"id":"2","cell":["2","2009-06-08","CLI-2","45000","5000","50000","cli-2"]},
{"id":"3","cell":["3","2009-06-01","CLI-3","25000","5000","30000","cli-3"]}
]
}
Now it works fine !
Most Users Ever Online: 715
Currently Online:
60 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