I am trying to implement the actions on click on tabs in tabpanel using sencha. Somehow I am not able to get the alerts on clicking the tabs.
Here is my code. I have tried to use handler and listener both the approaches on different tabs but I am not able to get alert message with any of them.
Int.views.bottomTabs = new Ext.TabPanel({
dock: 'bottom',
tabBar: {
id:'bottomtab',
dock: 'bottom',
ui: 'dark',
layout: {
pack: 'center'
}
},
defaults: {
scroll: 'vertical',
xtype: 'button'
},
items: [
{
title: 'Tab1',
iconCls: 'und',
handler: function(){
alert('It is clicked');
},
{
title: 'Tab2',
iconCls: 'und',
listeners: {activate: update},
},
{
title: 'Tab3',
iconCls: 'und',
},
{
title :'Tab4',
iconCls: 'und',
}
]
});
var update = function() {
alert('tab2 is clicked');
}
Please help me on where am i doing wrong.
Thank you,