-
26 Apr 2007 2:08 PM #1
tab activate event help
tab activate event help
Hi,
I am having some trouble understanding how events work in Ext. I have the following code:
var id = 123;
dialogTabs.getTab(tabId).addListener('activate',activateRequestTab);
what is the parameters being passed to my "activateRequestTab" function? I would like to pass the "id" parameter to the function so every time I swicth tabs, i can carry out updates, and other related tasks, related to the id.
Thanks.
-
26 Apr 2007 5:26 PM #2
You can use:
scope depends on the context you want to run activateRequestTab in. Can be this, tab, window, or elseCode:var id = 123; dialogTabs.getTab(tabId).addListener('activate',activateRequestTab.createDelegate(scope, [id]));
If you need to preserve original argument (which is tab index) use:
Code:dialogTabs.getTab(tabId).addListener('activate',activateRequestTab.createDelegate(scope, [id], true));
-
10 Sep 2008 3:27 AM #3
Although I'm using Ext2.2, I thought it was a good idea to reuse this topic.
I have a more primary doubt/bug than the first described here. Excerpt of my code:
That 'alert' on event 'activate' never fires, although I switch,close and open multiple tabs. Any hint ?Code:tpanel = new Ext.TabPanel( { height: 600, width: 950, deferredRender: false, defaults: { closable: true }, //tabs only tbar: [ .... ] , listeners: { activate: function(panel) { alert('here!'); } } }); tpanel.render('filegrid');
Thanks in advanceLast edited by karma; 10 Sep 2008 at 9:28 AM. Reason: version information


Reply With Quote