Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Problem with page index when calling trigger("reloadGrid") with true scrolling enabled
25/02/2010
21:34
Avatar
haypet
Member
Members
Forum Posts: 11
Member Since:
25/02/2010
sp_UserOfflineSmall Offline

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!

27/02/2010
22:03
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

01/03/2010
19:55
Avatar
haypet
Member
Members
Forum Posts: 11
Member Since:
25/02/2010
sp_UserOfflineSmall Offline

Here is a link to working example that demonstrates this problem:

http://www.arnaco.com/test/

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');").

01/03/2010
20:01
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Please Look here

http://www.trirand.com/blog/?p.....id/#p15253

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information