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"}
]
}
|
|
<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