PDA

View Full Version : Tab - on close need to find which tab is closed



sanath_ko
20 May 2009, 9:34 PM
I have a tab panel and when a tab is closed, I need to find which tab is closed. I have used the following code in my tab panel implementation.



listeners: {
remove: function(tabPanel, tab) {
console.log('closed the panel with an id of: ' + tab.id);
}
}

but this tab.id returns a value such as "ext-comp-1017".

If I have added 4 tabs , I need to get the number of the tab as 3, when I remove the tab 3 from the panel.
How can this be implemented. Pls help..your help is really appreciated...

Animal
20 May 2009, 11:29 PM
You need the index when you actually have the tab item itself? :-/

If you must, you can look it up! TabPanel is a Container

sanath_ko
21 May 2009, 12:16 AM
Thanx for the reply animal....

I tried the following code.....


remove: function(tabPanel, tab) {
console.log('closed the panel with an id of: ' + tab.index);

}index returns me - undefined.... how can i properly implement this index...??
help is really appreciated..

Animal
21 May 2009, 1:50 AM
The TabPanel is a Container

http://extjs.com/deploy/ext-3.0-rc1.1/docs/?class=Ext.Container&member=items

Look it up!