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
Trigger Reload Grid
09/06/2009
10:56
Avatar
andthereitgoes
Member
Members
Forum Posts: 18
Member Since:
19/05/2009
sp_UserOfflineSmall Offline

is jQuery().trigger("reloadGrid") same as hitting the refresh button in the pager?

If it is, then the result is not the same.

Hitting refresh, reloads the grid from page 1

using jQuery().trigger("reloadGrid") does a refresh but stays on the same page

12/06/2009
00:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

To use trigger("reloadGrid") you should

jQuery("#mygrid").trigger("reloadGrid") in order to known which grid to trigger.

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.

12/06/2009
07:07
Avatar
andthereitgoes
Member
Members
Forum Posts: 18
Member Since:
19/05/2009
sp_UserOfflineSmall Offline

thanks for the reply, yes i do know i have to do jQuery(”#mygrid”).trigger(”reloadGrid”). my question was whether

jQuery(”#mygrid”).trigger(”reloadGrid”) and hitting the 'REFRESH' button on the pager do the same thing?

REFRESH button refreshes the GRID to page 1 ( incase if you are on say page 3 of 5)

jQuery(”#mygrid”).trigger(”reloadGrid”) just refreshes the current page and the same page is reloaded ( so if you are on page 3 of 5 you stay on page 3 )

17/06/2009
08:57
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I hope you answered to your problem.

To refresh a grid at first page

$("#mygrid").setGridParam({page:1}).trigger("reloadGrid") or to a page what you want.

to preserve the current page when you push refresh button in navigator

$("#mygrid").navGrid("#pager",{refreshstate:'current'},.....);

Hope this helps

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.

28/02/2010
23:47
Avatar
haypet
Member
Members
Forum Posts: 11
Member Since:
25/02/2010
sp_UserOfflineSmall Offline

I believe $("#mygrid").setGridParam({page:1}).trigger("reloadGrid") does not work when you use True Scrolling Rows (JSON, GET, URL) as it is is outline in my other post. I will try to post a working exampel later. It will keep page where it was.

01/03/2010
19:54
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
19:59
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Little confused, sorry.

In case when you use scroll : 1

please use the following code to reload the grid with certain page

$("#mygrid").trigger("reloadGrid",[{page:1}]);

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
21:25
Avatar
haypet
Member
Members
Forum Posts: 11
Member Since:
25/02/2010
sp_UserOfflineSmall Offline

$("#mygrid").trigger("reloadGrid",[{page:1}]);

works like a charm and I guess it is possible to set any parametr same way, right?

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

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

Hello,

This is only for the page - if you want to use other params do it so:

$("#mygrid").setGridParam(...).trigger("reloadGrid",[{page:1}]);

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
22:05
Avatar
haypet
Member
Members
Forum Posts: 11
Member Since:
25/02/2010
sp_UserOfflineSmall Offline

Thanks Tony,

On the same note... I've notices that when I call $("#mygrid").setGridParam(…).trigger("reloadGrid",[{page:1}]); with same parametrs it does not send request, but instead uses cashed data? So I was wondering how can I force grid to do fresh request to server?

Thanks

05/03/2010
12:14
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

How do you set your other parameters?

if you want to add a parameter to the request you should

$("#mygrid").jqGrid('setGridParam',{postData:{...here your new params}});

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.

23/06/2011
17:40
Avatar
wangyf2010
New Member
Members
Forum Posts: 1
Member Since:
23/06/2011
sp_UserOfflineSmall Offline

Hi, Tony,

I'm using 3.8.2,

I'm trying to use below code to reload data from server side and show specific page, like current page. $("#mygrid").setGridParam({datatype:json}).trigger("reloadGrid",[{page:5}]);

grid could load data from server properly, but always show first page instead of page 5.

I think haypet should have the same case to me, could you clarify it for me?

Regards

Simon

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
44 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