Forum
20:22
24/01/2014
I've got jqGrid set up to do AJAX calls. The initial page loads, but the pager buttons don't work. I can page by changing the page number in the text box and clicking Enter. An AJAX call gets made with the new page number and the new page of data displays properly. When I click on any of the pager buttons no AJAX call is made, however. The buttons seem to be disabled by default.
What do I have to do to get the pager buggons to work?
20:31
22/05/2013
hard to tell without sample code and the json response, but i think i have seen this happen in a couple of cases
1) when I did not properly set the "records" count in the response.
2) when the "rowNum" attribute of the grid is set to nothing (ie '' ). You can set the rows attribute to a high number to work around this
In both cases though, the result is that the grid isn't able to calculate that multiple pages are available so the paging buttons are disabled.
21:58
24/01/2014
Here's the code. I had to copy and past one line at a time because this forum software reverses line of code copied and pasted (first line of code last, last line of code first). This is the worst forum software I've ever seen.
$("#grid").jqGrid({
datatype: "json",
url: "/mtprest/Product/productByStatus?status=awaiting",
jsonReader : {
root:"products",
page: "currentPage",
total: "totaPages",
records: "totalRecords",
repeatitems: false,
id: "0"
},
pager: "#pager",
colModel: [
...
],
rowNum: 6,
viewrecords: true
});
$("#grid").jqGrid("navGrid", "#pager");
22:16
24/01/2014
The number of rows is coming back. It shows up in the lower right corner. Sorry I can't post an image on this forum software, but the total number of records shows up as well as the correct record enumeration for the current page.
The text control works if I type in a new page number followed by Enter. It's just the buttons that dont work.
Here's the JSON
{"currentPage":2,"totalPages":3,"totalRecords":18,"products":[{"invid":49411615,"serialNumber":"2173J244SP","sONumber":"5137269","partNumber":"59701-32","desc":"Kit - Receiver, Dual Autonomous/SBAS/DGPS GPS-only, MS992, Carry Case, GCS","shippedDate":null,"soldDate":null,"status":"Awaiting Validation"},{"invid":49411616,"serialNumber":"2173j235sp","sONumber":"5137269","partNumber":"59701-32","desc":"Kit - Receiver, Dual Autonomous/SBAS/DGPS GPS-only, MS992, Carry Case, GCS","shippedDate":null,"soldDate":null,"status":"Awaiting Validation"},{"invid":49411617,"serialNumber":"2173j259sp","sONumber":"5137269","partNumber":"59701-32","desc":"Kit - Receiver, Dual Autonomous/SBAS/DGPS GPS-only, MS992, Carry Case, GCS","shippedDate":null,"soldDate":null,"status":"Awaiting Validation"},{"invid":49411618,"serialNumber":"2173J582SP","sONumber":"5137269","partNumber":"59701-32","desc":"Kit - Receiver, Dual Autonomous/SBAS/DGPS GPS-only, MS992, Carry Case, GCS","shippedDate":null,"soldDate":null,"status":"Awaiting Validation"},{"invid":49411619,"serialNumber":"2173J606SP","sONumber":"5137269","partNumber":"59701-32","desc":"Kit - Receiver, Dual Autonomous/SBAS/DGPS GPS-only, MS992, Carry Case, GCS","shippedDate":null,"soldDate":null,"status":"Awaiting Validation"},{"invid":49411620,"serialNumber":"1956042675","sONumber":"1042427","partNumber":"63610-00","desc":"Trimble Business Center Advanced - Dongle License","shippedDate":null,"soldDate":null,"status":"Awaiting Validation"}]}
I've checked that it is valid json at http://www.freeformatter.com/json-validator.html. The rows in the table contain the correct data.
It's just the buttons that don't work.
Adding "pgbuttons: true," didn't help
22:23
22/05/2013
I see that you are trying to customize which items to use in the response
page: "currentPage",
total: "totaPages",
records: "totalRecords",
I tried it on my setup and it doesn't seem to be working for me. the pagers are greyed out. Can you try using the default parameters by removing the above lines from your jqgrid config and then sending the response back with the json constructed like this ?
Unless you have a good reason to require renaming the default parameters in the response ?
22:39
24/01/2014
13:29
Moderators
30/10/2007
Hello,
Â
Thanks for the feedback.
Â
Kind Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
33 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