PDA

View Full Version : Event name of Tabpanel by clicking on the same active tab



Sneha004
23 May 2012, 1:55 AM
Hi,

Can anyone help me regarding to tabpanel event?

One tab is activated in tabpanel.
Is there any event will be fired by clicking on the same tab again?
I want to write that event in controller not in view.
I have written in view using listeners as follow :
{xtype : 'tabpanel',
items:[{
title : 'Vehicle',
tabConfig : {
listeners : {
click : function() {
alert('Vehicle Tab');
}}}}]
}

But I want to write it in controller .

How can I write it , Plz give some suggestion

friend
23 May 2012, 3:32 AM
In your Controller's init() method, you can do something like this:



init : function() {

this.control({
'tabpanel tab' : {
click: function(button, event, eOpts) {
Ext.Msg.alert('"Tab Clicked', 'Tab text is: ' + button.getText());
}
}
});

}

Sneha004
23 May 2012, 6:26 AM
Thanks a lot.

Its working now. :)