Events
The Telerik UI ColorPalette for ASP.NET Core exposes a Change
event that allows you to control the behavior of the UI component.
For a runnable example on the component Change
event, refer to the demo on using the events of the ColorPalette.
Handling by Handler Name
The following example demonstrates how to subscribe to the Change
event by a handler name.
@(Html.Kendo().ColorPalette()
.Name("colorpalette")
.Events(e => e
.Change("colorpalette_change")
)
)
<kendo-colorpalette name="colorpalette" on-change="colorpalette_change">
</kendo-colorpalette>
<script>
function colorpalette_change(e) {
// Handle the change event.
var colorpalette = this;
console.log(colorpalette.value());
}
</script>
Handling by Template Delegate
The following example demonstrates how to handle the Change
event by a template delegate.
@(Html.Kendo().ColorPalette()
.Name("colorpalette")
.Events(ev => ev
.Change(@<text>
function(e) {
// Handle the change event inline.
console.log(e.sender.value());
}
</text>)
)
)
<kendo-colorpalette name="colorpalette"
on-change="function(e) {
// Handle the change event inline.
console.log(e.sender.value());
}">
</kendo-colorpalette>