Events
The FlatColorPicker for ASP.NET Core exposes the Change()
event that you can use to further manipulate the component or other HTML elements as per your requirements.
For a complete example on FlatColorPicker events, refer to the demo on using the events of the FlatColorPicker.
Handling by Handler Name
The following example demonstrates how to subscribe to events by a handler name.
@(Html.Kendo().FlatColorPicker()
.Name("flatcolorpicker")
.Events(e => e
.Change("flatcolorpicker_change")
)
)
<script>
// The FlatColorPicker instance is available as an e.sender or this.
function flatcolorpicker_change(e) {
// Handle the change event.
}
</script>
<kendo-flatcolorpicker name="flatcolorpicker" on-change="flatcolorpicker_change" >
</kendo-flatcolorpicker>
<script>
// The FlatColorPicker instance is available as an e.sender or this.
function flatcolorpicker_change(e) {
// Handle the change event.
}
</script>
Handling by Template Delegate
The following example demonstrates how to subscribe to events by a template delegate.
@(Html.Kendo().FlatColorPicker()
.Name("flatcolorpicker")
.Events(e => e
.Change(@<text>
function(e) {
//Handle the change event inline.
}
</text>)
)
)
<kendo-flatcolorpicker name="flatcolorpicker"
on-change="function(){
// Handle the change event.
}">
</kendo-flatcolorpicker>