Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hello Experts,
 
(Web application information- I am using ASP.NET MVC, .Net framework 4 and C#)
 
I am using jqgrid on a webpage(view) to display contents from model.
 
$("#list").jqGrid({
            url: '<%= @Url.Action("ViewData", "Data") %>',
            datatype: 'json',
            mtype: 'GET',
            ...
            ...
            ...
            toppager: true,
            pager: jQuery('#pager'),
            rowNum: 10,
            rowList: [5, 10, 20, 50],
            sortname: 'ID',
            sortorder: "desc",
            multiselect: true,
            viewrecords: true,
            ...
            ...
            ...
 
and my controller is this
 
 [SessionExpireFilter]
        public ActionResult ViewData(string sidx, string sord, int page, int rows ,GridSettings grid)
        {
            // code goes here..
            // return JSON object.
            
        }
 
I have applied Virtual Scrolling, so whenever the user will scroll on the page, the data will be loaded in jqgrid.
 
PROBLEM:
When I debugged the application, the "page" parameter in controller must show incremental values at each scroll but it is not behaving normally.
-If I keep the "sortOrder" as "desc" then the "page" values I get in controller are '1' in first pass, '3' in second pass, '5' in third pass and so on.
 
-If I keep the "sortOrder" as "asc" then the "page" values I get in controller are '1' in first pass, '2' in second pass, '5' in third pass, '6' in fourth pass and so on.
 
I have tried my level best to find out where the problem lies but I am not able to find the reason behind this. Frown | :(
 
Any help would be highly appreciated.
Thanks in advance.
Posted 8-Apr-13 21:41pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello folks,
 
I got the solution after some more research.
 
The problem was occurring due to the bug in jqgrid.
 
I was using jqgrid version 4.4.1 and I read that pagging bug was solved in version 4.4.3
 
I gave a try, updated the latest version ( jqgrid version 4.4.4) in my application and now all's working perfectly fine.
 
Regards,
Shivang
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,569
1 Sergey Alexandrovich Kryukov 6,168
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 10 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100