DHTMLX Docs & Samples Explorer

Index
dhtmlxtabbar

## Events Handling

The following events are available in dhtmlxTabbar:

- onTabClose - occurs when tab closed by close button
- onSelect - occurs when tab selected
- onXLS - occurs when xml loading started
- onXLE - occurs when xml loading finished
- onTabContentLoaded - occurs when content of tab loaded ( for ajax-html mode only )

### Attaching/Removing Event Handler

The user can add any user-defined handler to any of the available events. To do this, the user can use attachEvent() method with the following parameters:

- evName - name of the event;
- evHandler - user-defined event handler.

            tabbar.attachEvent(evName, evHandler);

Several handlers can be attached to one and the same event, and all of them will be executed. Note: the names of the events are case-sensitive.

There is a simple way of removing an event-handler:

            var id = tabbar.attachEvent(evName, evHandler);
            //...
            tabbar.detachEvent(id); // unique id of the event handler

Parameter of detachEvent is the event's ID , it is the value, which was returned by related attachEvent command.