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
auto reload grid/cells
21/10/2009
09:30
Avatar
jsank
Member
Members
Forum Posts: 3
Member Since:
15/10/2009
sp_UserOfflineSmall Offline

I'm loving jqgrid but I have a question-

I used jgrid to display a queue (basically, it just shows the data in a table) - the data on the backend changes periodically so I want to refresh the grid or certains cells when those changes occur.  For now, I'm using the 'loadComplete' function, the native js setInterval, and the jqgrid function trigger:

jQuery("#list").jqGrid...

 ... loadComplete:startAutoRefreshing

function startAutoRefreshing(){

      setInterval(function(){
                jQuery("#list").trigger("reloadGrid");
        },10000);
}

Is there a better way to do this?  More importantly, I have a problem - the refreshes seem to take longer and longer.  If I load the page, after 10secs I see the 'loading...' notice pop up for a second.  Ten seconds later it pops up for a little longer.  After a few minutes, it pops up for the full 10 secs - effectively it never goes away.

Any thoughts on why this is happening?

Thank you!

21/10/2009
10:39
Avatar
Rumen[Trirand]
Moderator
Members

Moderators
Forum Posts: 81
Member Since:
08/10/2009
sp_UserOfflineSmall Offline

Interesting, since this seems weird (I mean why it would take progressively longer upon each request). So can you please try the following, instead of using the loadComplete event, set a global setTimeout handler for that, e.g.

window.setTimeout( startAutoRefreshing, 10000);

and see if you get better results?

Trirand ASP.NET WebForms & MVC components based on jQuery & ThemeRoller

http://www.trirand.net

21/10/2009
13:14
Avatar
jsank
Member
Members
Forum Posts: 3
Member Since:
15/10/2009
sp_UserOfflineSmall Offline

I gave that a shot - same result.

23/10/2009
11:38
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I think that adding this to  loadComplete is not a good idea.

You should just after the grid is loaded do (NOT in any grid event)

setInterval(function(){  jQuery(”#list”).trigger(”reloadGrid”); },10000);

Which will refresh the grid after this interval

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.

26/10/2009
08:58
Avatar
jsank
Member
Members
Forum Posts: 3
Member Since:
15/10/2009
sp_UserOfflineSmall Offline

Thanks for all the help - Tony and Rumen - I thought that I had tried the simple setInterval option that Tony suggested but I must have messed it up because I just tried it again and it works great!

Thanks again!

23/11/2009
08:29
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

I also use this method

setInterval(function(){jQuery(”#list1″).trigger(”reloadGrid”);}, 5000);

but I “see” the refresh, I mean the grid is flashing at each refresh. Normally with ajax I should not see this “flash”.

Did you set an appropriated property ?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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