DHTMLX Docs & Samples Explorer

Events Handling

List of supported events

The following events are available in dhtmlxCombo:

  • onChange - fires when the combo's value changed;
  • onSelectionChange - fires when the preselected value inside combo changes ( it differs from onChange event, because previous one occurs only when value really changed);
  • onKeyPressed -fires right after the key is pressed inside combo;
  • onBlur - fires when the focus is moved out from the combo;
  • onOpen - fires when the combo list opens;
  • onDynXLS - fires when the combo list is being populated with data from the server;
  • onCheck -fires when a checkbox is clicked.

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.
        combo.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:

        combo.detachEvent(id); // unique id of the event handler