Events
You can subscribe to the Open
, Close
, and Change
TimePicker events and further customize the functionality of the component.
For a complete example on basic TimePicker events, refer to the demo on using the events of the DateRangePicker.
Handling Events by Handler Name
The following example demonstrates how to subscribe to events by a handler name.
@(Html.Kendo().TimePicker()
.Name("timepicker")
.Events(e => e
.Open("timepicker_open")
.Close("timepicker_close")
.Change("timepicker_change")
)
)
<kendo-timepicker name="timepicker"
on-open="timepicker_open"
on-close="timepicker_close"
on-change="timepicker_open"/>
function timepicker_open() {
// Handle the open event.
}
function timepicker_close() {
// Handle the close event.
}
function timepicker_change() {
// Handle the change event.
}
Handling Events by Template Delegate
The following example demonstrates how to subscribe to events by a template delegate.
@(Html.Kendo().TimePicker()
.Name("timepicker")
.Events(e => e
.Open(@<text>
function() {
// Handle the open event inline.
}
</text>)
.Change(@<text>
function() {
// Handle the change event inline.
}
</text>)
.Close(@<text>
function() {
// Handle the close event inline.
}
</text>)
)
)
<kendo-timepicker name="timepicker"
on-open='function(e)
{
// Handle the open event inline.
}'
on-change='function(e)
{
/ Handle the change event inline.
}'/>
on-close='function(e)
{
/ Handle the close event inline.
}'/>