Forum


09:30

15/10/2009

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!
10:39

Moderators
08/10/2009

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
11:38

Moderators
30/10/2007

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66