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_TopicIcon
change jqGridReader for key-value pairs of json data
06/01/2011
08:48
Avatar
gunjan shah
India
Member
Members
Forum Posts: 20
Member Since:
23/12/2010
sp_UserOfflineSmall Offline

Hello Friends,

 I am using jqGrid which retrieves the data from the server. It returns the jSon Object . Json object contains key/value pairs .

json.put(d.getDenomId(), d.getDenomAmt());

I want to handle this data at client side using jqGrid . I can not understand that How to change the structure of jsonReader as per my requirement.

Can anyone help me ?

In my Grid , there are two row, one is "ID" and second is "Value" . The json object retruns the id-values pairs.

Then what will be the value of root and other things in jsonReader ?

Thanx,

Gunjan Shah.

06/01/2011
15:04
Avatar
izumeroot
Russia
Member
Members
Forum Posts: 17
Member Since:
18/11/2010
sp_UserOfflineSmall Offline

can you show result json?

07/01/2011
07:37
Avatar
gunjan shah
India
Member
Members
Forum Posts: 20
Member Since:
23/12/2010
sp_UserOfflineSmall Offline

Hello Izumeroot,

    Format of json is :

{"rows":[{"id":1123,"cell":[1123,300]},{"id":1087,"cell":[1087,300]},{"id":1067,"cell":[1067,301]},{"id":1064,"cell":[1064,500]},{"id":1174,"cell":[1174,2000]}]}

Its working fine in internet explorer, but fireFox's error console shows the error : "not well formed" .

Thanx..

Gunjan Shah.

07/01/2011
11:00
Avatar
izumeroot
Russia
Member
Members
Forum Posts: 17
Member Since:
18/11/2010
sp_UserOfflineSmall Offline

I have such json in my grid:

{"page":"1","records":3,"total":1,"userdata":"","rows":[{"id":"1","title":"Wrong Title After Saving","date":"2010-09-03","is_active":"1","status":"New Ticket"},{"id":"2","title":"Can't remove a record","date":"2010-10-12","is_active":"1","status":"Assigned"},{"id":"3","title":"Add refresh button fro grid","date":"2010-12-07","is_active":"1","status":"Done"}]}

My jsonReader is:

jsonReader: {
 root: "rows",
 page: "page",
 total: "total",
 records: "records",
 repeatitems: false,
 id: "0"
 }

But I also use another json structure for default jsonReader :

{"page":"1","records":3,"total":1,"userdata":"","rows":[{"cell":["652ABB6C2E4784317CA9222A23BA8940","test_usr_r@mail.test","1","10 \u0441\u0435\u043d 2010","0","0","0"]},{"cell":["652ABB6C2E4784317CA9222A23BA8940","user2@mail.test","1","20 \u0438\u044e\u043b 2010","0","0","0"]},{"cell":["652ABB6C2E4784317CA9222A23BA8940","izumeroot@gmail.com","1","23 \u0430\u0432\u0433 2010","0","0","0"]}]}

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
40 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