PDA

View Full Version : first time tab activate



sjivan
22 Dec 2006, 10:50 PM
I need to run some js code only when the tab is first activated, and not on subsequent activations. Any good way to do this other than add a flag to the TabPanel prototypeor a local flag? The requirement is sort of like the loadOnce param of the setUrl() call.

Basically I have a FCKEditor in one of the tabs and dont want to have the text area converted to a fckeditor unless the user clicks on the tab because the js code to convert the textarea to an fckeditor takes a fair amount of time.

Thanks,
Sanjiv

jack.slocum
23 Dec 2006, 4:24 AM
var tab = ...;
var onActivate = function(){
tab.removeListener('activate', onActivate);
// do your stuff
}
tab.on('activate', onActivate);

sjivan
23 Dec 2006, 8:25 AM
Works well. thanks!