Forum


21:34

25/02/2010

Hi,
I am using jqGrid 3.6.4 with dataType: "json", mtype: "get". Grid work great in general. But I am running into problem with following scenario:
1. Load initial grid so it has data for multiple pages (in my case 3 pages with 40 rows in each page).
2. Scroll to 3rd page. You will notice that "beforeRequest" event is called twice most of the time with page = 2 and then page = 3.
3. Call trigger("reloadGrid") and you will see that request is sent with page index caring over.
The problem is, that I call trigger("reloadGrid") to reload data with new filters, so keeping page index is not acceptable for me, because returned data can be only 30 records, so there is no information displayed in the grid. I've tried to set page index in beforeRequest event, but it didn't help, actually it causes jquery error.
So my question is...how can I achieve my goal, so grid is truly reloaded with page index being 1 (like what happens when you try to sort the grid).
Thank you anyone for help and support!
22:03

Moderators
30/10/2007

Hello,
Sorry, but I do not understand what is acctually the problem. Please can you explain simple and post your code?
Best Regards
Tony
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.
19:55

25/02/2010

Here is a link to working example that demonstrates this problem:
On the page there are 2 buttons. First loads grid with 500 records, second with only 40. Please use following steps to recreate:
1. Click first "Reload Grid" (top left) button and see grid loads.
2. Scroll grid to Page #20, so it shows records 201 - 240.
3. Click second "Reload Grid With Less Data" button and see grid reloads, but page index is carried over from previouse request.
If you view source of aspx page you will see that onclick I will explicitly set {page: 1} ($('#scrolling').setGridParam({page:1, filter: 1}).trigger('reloadGrid');").
20:01

Moderators
30/10/2007

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:
82 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