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

Event names are case-insensitive.

Detaching event listeners​

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

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

Calling events​

You can call events with the timepicker.events.fire() method:

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

The API section lists all Timepicker events.