Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
jqGrid refuses to show Json data - config very similar to examples
23/02/2012
06:09
Avatar
alexgreatmk
New Member
Members
Forum Posts: 2
Member Since:
23/02/2012
sp_UserOfflineSmall Offline

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

25/02/2012
05:53
Avatar
alexgreatmk
New Member
Members
Forum Posts: 2
Member Since:
23/02/2012
sp_UserOfflineSmall Offline

Fixed it the manual way... build a data structure that conforms to jqGrid's requirements explicitly.

Moving on.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
24 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information