Forum



06:09

23/02/2012

I'll try to be concise.
Configuration:
$("#tblLines").jqGrid({
datatype: "json",
url: '@Url.Action("MyAction", new {rows = 5, page = 0})',
jsonReader: { repeatItems: true,
root: "invdata",
page: "currpage",
total: "totalpages",
record: "totalrecords",
cell: "",
id: "Id"
},
colModel: [
{ name: 'Id', editable: true, sortable: false, hidden: true },
{ name: 'Val1', editable: true, sortable: false, hidden: false },
{ name: 'Val2', editable: true, sortable: false, hidden: false },
{ name: 'Val3', editable: true, sortable: false, hidden: false },
{ name: 'Val4', editable: true, sortable: false, hidden: false },
{ name: 'Val5', editable: true, sortable: false, hidden: false },
{ name: 'Val6', editable: true, sortable: false, hidden: false },
{ name: 'Val7', editable: true, sortable: false, hidden: false },
],
rownum: 0
});
JSON returned by 'MyAction':
{"totalpages":1,
"currpage":1,
"totalrecords":10,
"invdata":[
{"Id":0,"Val1":1,"Val2":2,"Val3":3,"Val4":4,"Val5":5,"Val6":6,"Val7":7,"OtherProp":null},
{"Id":1,"Val1":1,"Val2":2,"Val3":3,"Val4":4,"Val5":5,"Val6":6,"Val7":7,"OtherProp":null},
{"Id":2,"Val1":1,"Val2":2,"Val3":3,"Val4":4,"Val5":5,"Val6":6,"Val7":7,"OtherProp":null}]
}
The JSON is produced by a .NET library (so not manually).
I was trying to follow the examples as closely as possible, but still nothing.
Any ideas?
Btw… good job with the product – I can see this to be an invaluable tool once I get past this nuisance.
Thanks!
M
Most Users Ever Online: 715
Currently Online:
61 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