Skip to main content

Event handling

Attaching event listeners

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

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

Related sample: Timepicker. Events

note

The names of events are case-insensitive.

Detaching event listeners

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

timepicker.events.on("change", function(value){
console.log("The value of a timepicker has changed to "+ value);
});
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.