Forum
18:55
22/11/2010
Hi there,
Not sure if this is a bug, but I can't seem to get this working properly. We have a solution that is written in ASP.NET using MVC2 and jQuery. I'm using version 3.8.1 of the grid and jQuery version 1.4.4. What we aim to do, is to load the structure of the grid when the page loads with the relevant data for the first page, and then use ajax requests after that to handle any subsequent data calls (paging, sorting, filtering, etc.)When the page loads, on the document ready handler of jQuery, I use the jqGridImport method to retrieve the structure of the grid. The code that I use for this looks something like:
</table>
<div id="jqGridPager">
</div>
In the json result that comes back, I include the only the necessary data that should be displayed on the first page of the grid, as well as all the other relevant information, like total number of pages, total records in query, etc. In my test example, the returned json result looks as follows:
{"grid":{"caption":"","width":500,"hoverrows":false,"url":"/Home/GetGridData","datatype":"json","rowNum":5,"colModel":[{"label":"ID","name":"ID","index":"ID","width":70,"title":false}],"gridview":true,"viewrecords":true,"shrinkToFit":false,"pager":"#jqGridPager","loadui":"none","hidegrid":false,"ajaxGridOptions":{"cache":false},"ajaxSelectOptions":{"cache":false}},"data":{"total":4,"page":1,"records":20,"rows":[{"id":"1","cell":["1"]},{"id":"2″,"cell":["2"]},{"id":"3″,"cell":["3"]},{"id":"4″,"cell":["4"]},{"id":"5″,"cell":["5"]}]}}
As you can see from this, I tell the grid (in the data tag) that there are a total of 4 pages and a total recordcount of 20. As mentioned previously, I do however only send through 5 rows of data to correspond with the grid parameter (rowNum = 5). I also set the url property of the grid to retrieve any subsequent data requests from the server. I would expect the pager of the grid to display "Page 1 of 4″ and "View 1-5 of 20″, but instead I see "Page 1 of 1″ and "View 1-5 of 5″.
Are there any properties in the grid that I should set to get this working, or am I approaching the problem in the wrong way? Please let me know if you require any additional information. Any help would be greatly appreciated.
Regards
Julian
Most Users Ever Online: 715
Currently Online:
29 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