No tabbar event for when tab is switched to

I’m trying to perform an operation on a newly selected tab by attaching an event to the tabbar.

control_tabbar.attachEvent("onTabClick", function(id){
            control_tabbar.cells(id).autoSize();
            //alert("resizing tab");
        });

Unfortunately, this performs the operation on the tab that was active when the new tab was clicked – not on the tab that I’m switching to.

Both the “onTabClick” and “onSelect” events seem to fire before the selected tab becomes active. And since I’m using setContentHTML to add the content to the tabs, “onTabContentLoaded” doesn’t fire at all.

Is there any way to execute this code AFTER the tab I’ve selected becomes the active tab?

Nevermind, got working by adding a timeout:

control_tabbar.attachEvent("onSelect", function(id){

            window.setTimeout(function(){
                control_tabbar.cells(id).autoSize();
                //alert("resizing tab");
            },1);
            return true;

});

Try to use
tabbar.enableAutoSize(false,true);
dhtmlx.com/docs/products/dht … ntent.html