DHTMLX Docs & Samples Explorer

Index
dhtmlxtoolbar

## Event Handling

### Available Events

The following events are available in dhtmlxToolbar:

- onClick - occurs when the user clicks the left mouse button on Button or Select Button items.
- onStateChange - occurs when the user changes state of Two State Button item;
- onValueChange - occurs when the user changes value of Slider item;
- onXLS (XML Loading Start) - occurs when XML data loading has not started yet; this method is called before onLoadHandler (which is set in loadXML() method);
- onXLE (Xml Loading End) – occurs when XML data was completely loaded into the object; this method is called before onLoadHandler (which is set in loadXML() method);
- onEnter - occurs when the user presses “Enter” button in the Input item.

### Attaching Event Handler

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

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

        toolbar.attachEvent(evName, evHandler);

Note: the names of the events are case-insensitive.