PDA

View Full Version : Change event on TabPanel



pe_la_do
28 Jul 2010, 6:39 AM
Hi,
I need capture when user change tab in a TabPanel component.
I could not find anything about it.

Anyone know ?

Thanks

evant
28 Jul 2010, 7:30 AM
Ext.setup({
icon: 'icon.png',
glossOnIcon: false,
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
onReady: function() {
new Ext.TabPanel({
fullscreen: true,
type: 'dark',
sortable: true,
id: 'tabs',
listeners: {
cardswitch: function(tabPanel, newTab, oldTab, index){
alert('changed to ' + index);
}
},
items: [{
title: 'Tab 1',
id: 'tab1',
html: '1',
cls: 'card1'
}, {
title: 'Tab 2',
id: 'tab2',
html: '2',
cls: 'card2'
}, {
title: 'Tab 3',
id: 'tab3',
html: '3',
cls: 'card3'
}]
});
}
});

pe_la_do
28 Jul 2010, 7:33 AM
Thanks.

I use method change instead of cardswitch and works well.