PDA

View Full Version : how to use or make a on('refresh') event for tab



suzie
18 Oct 2007, 5:37 AM
Hello,

I want to launch a function just after a tabpanel is refreshed:

something like this :
thistab.on('refresh', refreshfunction());
thistab.setUrl(thisurl+'?AjaxTarget=1',null, true);
thistab.refresh();

is there a way to catch the event when the content of the panel is completely loaded after a refresh ?

tryanDLS
18 Oct 2007, 8:47 AM
There isn't a specific event, but if you look at the source of TabPanelItem you'll see that under the covers it uses UpdateManager, which means that via the TabPanelItem.setUrl method, you can pass additional parms, one of which can be a callback fn which will get called when the refresh completes.

suzie
19 Oct 2007, 5:48 AM
thanks for answer,

Y tried different codes to use a callback function after the setUrl and refresh but no one works :

innerLayout.getRegion('center').getPanel('center_tab').on('tabchange',
function() {
createTabs();
}
);
innerLayout.getRegion('center').getPanel('center_tab').on('update',
function() {
createTabs();
}
);

---------------------------------------------------
thistab = innerLayout.regions.center.tabs.getTab('center_tab')
thistab.setUrl(thisurl+'&AjaxTarget=1', { callback :function() {
createTabs();
}
},
true);
-------------------------------
var mgr = new Ext.UpdateManager("center_tab");
mgr.on("update", createTabs);
---------------------------------------