Forum


10:46

28/12/2009

Hi all
I'm having trouble with getting my json reader to work. This is the example output from my server:
My jsonreader is like this:
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
id: "0"
},
Can someone see whats wrong?
Thanks
/x
10:52

Moderators
30/10/2007

Hello,
Set repeaitems to true. Please read the docs before posting
http://www.trirand.com/jqgridw.....#json_data
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.
11:07

28/12/2009

I have read the docs. The say I should set it to false? I cant get the example below to work either…
http://www.trirand.com/jqgridw.....#json_data
…
jsonReader : {
root:“invdata”,
page: “currpage”,
total: “totalpages”,
records: “totalrecords”,
repeatitems: false,
id: “0″
},
…
});
The resulting data in our example should be:
totalpages: “1″,
currpage: “1″,
totalrecords: “2″,
invdata : [
{invid:"1",invdate:"cell11", amount:"cell12", tax:"cell13", total:"1234", note:"somenote"},
{invid:"2",invdate:"cell21", amount:"cell22", tax:"cell23", total:"2345", note:"some note"}
]
}
My script for displaying the data above:
url:'stats?player=x',
datatype : 'json',
mtype:'POST',
colNames:['invid','invdate','amount','tax','total','note'],
colModel : [
{name:'invid', width:30, sortable:true, align:'center'},
{name:'invdate', width:40, sortable:false, align:'center'},
{name:'amount', width:180, sortable:true, align:'left'},
{name:'tax', width:380, sortable:true, align:'left'},
{name:'total', width:0, sortable:false, align:'center'},
{name:'note', width:0, sortable:false, align:'center'}
],
sortname: “invid”,
sortorder: “asc”,
pager: '#pager',
rowNum:15,
rowList:[15,30,50],
caption: 'example',
viewrecords:true,
jsonReader : {
root:”invdata”,
page: “currpage”,
total: “totalpages”,
records: “totalrecords”,
repeatitems: false,
id: “0″
},
width: 700,
height: 200
});
Doesnt work. Thanks for helping.
/x
Most Users Ever Online: 715
Currently Online:
50 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