DHTMLX Docs & Samples Explorer

Index
dhtmlxaccordion

# Events

DhtmlxAccordion allows to handle different kinds of events in an application.

You can attach several handlers to the same event, and all of them will be executed.

Event names are case-insensitive.

## Adding event

If you need to attach event to an application, use the attachEvent() method.

    dxhAccord.attachEvent(evName, evHandler);

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

## Deleting Event

You can also delete event if you have such possibility. The detachEvent() method helps you here.

    var id = dhxAccord.attachEvent("onActive",some_code);
       ...
    dhxAccord.detachEvent(id);

## The list of events

The following events are available in dhtmlxAccordion:

- onActive - occurs when the user clicks the left mouse button on item's heading;
- onBeforeActive - occurs when the user clicks on an item but before this item becomes active and open;
- onDock - occurs when the window dockes into the accordion;
- onUnDock - occurs when the accordion's cell undockes into the windows.