noone has any insights on this?
/x
I think I got it. It was how the json was outputed on the server. I was missing some “.
Thanks for all the help.
/x
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
jQuery(“#gridid”).jqGrid({
…
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"}
]
}
|
1 |
<span class="br0"><br />My script for displaying the data above:<br /><br /> </span><span class="br0"><br /></span> |
jQuery(”#table”).jqGrid ({
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
Should I have this on my page or not ?
Ok, my reader is like this:
ok. so I need to define my own reader. Where do I do that?
My output is like this:
[{“matchID”:”123456″,”hero”:”mrx”,”score”:”0″,”xp”:”0″,”creeps”:”0″,”result”:”0″,”psr”:”-0″,”kd”:”0″}]
So I dont really have a root. Can it be empty?
/x
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top