Hi -
I am trying to do something when a content panel gets activated/clicked.
For some reason, when I click on the tab, the function does not get fired at all. am I missing something.
layout.add('west', tab22= new Ext.ContentPanel('xxx',{
autoCreate:true,
title: 'Tab 22',
fitToFrame:true,
closable: false,
listeners: {
'click': alert('call me')
}
}));
This script gets called during the load event of the page and not during the click event of the tab.
tab22.on('click', alert('been clicked'), this);
The above does the same thing !!
Please help.
Thanks
Joseph
Please post your code in CODE tags, not bold.
This has been covered many times. You're executing the alert immediately on assigning the handler. You need to wrap that in an anonymous function or make it a reference a local function in your code, without parens, that will executed when the event occurs.
The event is activate, not active.
Oops... sorry about it !! thanks for pointing it out.
I am trying to do this, but am having no luck. Am I missing something?
layout.add('west', lab2 = new Ext.ContentPanel('tab22', {title: 'Details', fitToFrame:true}));
tab22.on('active', function() {
callWhileActive();
});
var callWhileActive= function(){
alert('in here');
};
Let me know... thanks !!
Accessing Layout from iframe window
Collaped panel doesn't update until expanded with toggle
|