tabbar & onTabClose

Hi hi.

// tab closing problem when using onTabClose event
viewport.tabbar.onTabClose = function() {
// decrease tab counter
viewport.tabbar.numRows–;
// unset tabbar when empty to get a clean, nice screen
// reattach again when a new tab gets created
if(0==viewport.tabbar.numRows) {
viewport.cells(“b”).detachObject();
viewport.tabbar=null;
}
}
viewport.tabbar.attachEvent(“onTabClose”, viewport.tabbar.onTabClose);

Thats the code.
My question: why is onTabClose fired for every tab?
There are 3 tabs opened, and all tabs + tabbar itsself closed when i only close 1 tab.
I mean, i close one! tab, and therefore one! close event should be fired.
It seams that 3 events are fired.
If its not a bug and not my fault (could be) its a big design prob.

Some ideas?

Use 3.5, compiled lib.

Hi
It seems to me, that it happens, because you haven’t use the parameter ID of this event
Please, reade the Doc about this event handler:
docs.dhtmlx.com/doku.php?id=dhtm … tabclose&s[]=onTabClose

Just in case I put a useful example. Try to use it. When tab is closing, the object is attaching on a document.body and not destroyed. It is possible at required to take it.
tabbar_sample.rar (80.5 KB)

Thanks very much.
Will pipeline your suggest within the next roundtrip at end of week.

Thanks in advance,
Alexander

Ok!