View Poll Results: How many parts in a page you need to auto refresh?
- Voters
- 3. You may not vote on this poll
-
1
0 0% -
2
1 33.33% -
3
0 0% -
4
1 33.33% -
5
1 33.33% -
6
0 0% -
7
0 0% -
8
0 0% -
9
0 0% -
> 9
0 0%
Hybrid View
-
29 Dec 2008 2:46 AM #1
How To Auto Reload Tab Panel Content?
How To Auto Reload Tab Panel Content?
Guys, can you tell me how to do auto reload tab panel content? For example:
I want to reload the tab "Screen Monitoring" so it will reload in certain seconds (ie: every 5 seconds it will reload the tab content) without refreshing the whole page.Code:var contentPanel = new Ext.TabPanel({ region:'center', deferredRender:false, activeTab:0, enableTabScroll:true, items:[{ autoLoad: {url: 'doMenuScreenMonitoring.php', scope: this}, title: 'Screen Monitoring', closable:false, autoScroll:true }] });
Thank you in advance for any body can help me by sharing the solution to me.
-
29 Dec 2008 2:49 AM #2
Get the Updater for that Panel.
http://extjs.com/deploy/dev/docs/?cl...ber=getUpdater
You'll have to explicitly create it as a Panel first and then use it as the item.
Then ask it to autoRefresh.
http://extjs.com/deploy/dev/docs/?cl...artAutoRefreshSearch the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
29 Dec 2008 12:06 PM #3
Confused of How To Use The getUpdater and startAutoRefresh
Confused of How To Use The getUpdater and startAutoRefresh
Hi Animal,
Thanks for you reply. By the way, can you explicitly tell me where to insert the code that you mean (getUpdater and startAutoRefresh)? Because I tried this and it was Javascript error:
The TabPanel which I want to use is exactly like what I mentioned above. And for your information the code above inserted in the body of Ext.onReady();Code:var contentPanel = new Ext.TabPanel({ region:'center', deferredRender:false, activeTab:0, enableTabScroll:true, items:[{ autoLoad: {url: 'doMenuScreenMonitoring.php', scope: this}, title: 'Screen Monitoring', closable:false, autoScroll:true }] }); contentPanel.getUpdater().startAutoRefresh(3);
Please show me the exact code where I need to insert the getUpdater and startAutoRefresh.
Thanks again for your kindness help.
-
30 Dec 2008 12:55 AM #4
Do you want to update the TabPanel?
Or that single Panel that you added as it's sole child item?Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
30 Dec 2008 6:34 PM #5
Update The Single Panel
Update The Single Panel
Hi Animal,
All I want to do is update the single Panel. I mean, if the 'contentPanel' variable consist of three tabs, the only I want to update is the tab "Screen Monitoring".
Can you represent to me the exact codes of how to do it?
Thank you for your kindness help.
-
31 Dec 2008 1:50 AM #6
Create the Panel first. So you get it in a variable. Then you can use the methods on it that I linked to. And use that variable as the item.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
5 Jan 2009 11:06 PM #7
not tested but how about this: -- ok, tested now and this works:
Code:var menuScreenPanel = new Ext.Panel({ autoLoad: {url: 'doMenuScreenMonitoring.php', scope: this}, title: 'Screen Monitoring', closable:false, autoScroll:true }); menuScreenPanel.on('render', function() { menuScreenPanel.getUpdater().startAutoRefresh(5, 'doMenuScreenMonitoring.php'); }); var contentPanel = new Ext.TabPanel({ region:'center', deferredRender:false, activeTab:0, enableTabScroll:true, items:[menuScreenPanel] });Last edited by jratcliff; 6 Jan 2009 at 10:49 AM. Reason: updated the code after testing it
-
6 Jan 2009 8:53 AM #8
Hi jratcliff,
I have tried it. But it still not working. The user interface became messed up because of the code:
But, if I commented out the above code, the UI back to normal, but no auto refresh happened.Code:menuScreenPanel.getUpdater().startAutoRefresh({ interval:5, url: 'doMenuScreenMonitoring.php' });
Do you have any idea how to do it? I have spent a week to find a way to do it.
I really need your help to find the way to do it.
-
6 Jan 2009 9:56 AM #9
My apologies. Again, I didn't test it last night and thus missed a couple of issues. I just tested this now and it works. You just need to change the code to run AFTER the panel has been rendered (oh, and I got the parameters wrong - should be two, with the first the number of seconds and the second, the url)
So change this:
To this:Code:menuScreenPanel.getUpdater().startAutoRefresh({ interval:5, url: 'doMenuScreenMonitoring.php' });
I'll go ahead and update my original response in case someone else needs this.Code:menuScreenPanel.on('render', function() { menuScreenPanel.getUpdater().startAutoRefresh(5, 'doMenuScreenMonitoring.php'); });
-
6 Jan 2009 10:20 AM #10


Reply With Quote
