Forum



19:05

14/02/2013

Thought some of you guys might find a tutorial/example I put together for using the jqGrid with a backend JSON feed. The backend is based on Spring MVC. The example uses JQuery and a select box to update the jqGrid contents. Hope you find it helpful.
11:44

10/08/2009

Hello,
I find in general very good to share his exerience with other people, but it's better to post more correct examples. I am not Spring MVC developer and not Java developer at all, but some clear errors I could see in the example which you posted here:
- you use very old version 1.4.4 of jQuery in the demo. Moreover you used in the same demo jQuery UI 1.10 which supports only jQuery starting with 1.6. So you should update the code to use for example jQuery 1.9.1.
- the server response of the server contains clear wrong data for records. The picture can display 20 rows per page and shows 4 rows. On the other side one can see "View 1 - 4 of 8" in the status. It's wrong information (see the line int totalNumberOfRecords = 8 in your code). You should modify your code to calculate total and records filed of the server response based on the number of records and the page size (rows).
- I recommend you include following options to jqGrid: height: "auto", gridview: true, autoencode: true, sortname: "firstName".
- you use in the demo index properties in colModel the same as the value of name property. I recommend you remove such index properties from colModel.
- you should include at least sorting of output data which you return
- I recommend you to use loadonce: true option if you provide the code without paging and filtering of the data.
Best regards
Oleg
12:49

14/02/2013

13:00

10/08/2009

You are welcome!
One more clear bug in the posted code is the usage of <meta charset="utf-8"> before <head>. I recommend you to validate posted HTML code in http://validator.w3.org/ and validate JavaScript code on http://www.jslint.com/ or http://www.jshint.com/.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
31 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