Event Handling

Attaching event listeners

You can attach event listeners with the timepicker.events.on() method:

var info = document.getElementById("events-info");
 
timepicker.events.on("Change", function(){
    console.log("The value of a timepicker has changed to "+timepicker.getValue());
});

Related sample:  Timepicker events - DHTMLX Timepicker

The names of events are case-insensitive.

Detaching event listeners

To detach events, use timepicker.events.detach():

timepicker.events.on("Change", function() {
    console.log("The value of a timepicker has changed to "+timepicker.getValue());
});
timepicker.events.detach("Change");

Calling events

To call events, use timepicker.events.fire():

timepicker.events.fire("name",args);
// where args is an array of arguments

The list of events is available in the API section.

Back to top