title | page_title | description | slug | position |
---|---|---|---|---|
Events |
Events |
Learn how to handle the events of the Telerik UI ExpansionPanel component for {{ site.framework }}. |
events_expansionpanel |
3 |
The Telerik UI ExpansionPanel for {{ site.framework }} exposes some events that allow you to control the behavior of the UI component.
For a complete example on the available component events, refer to the [demo on using the events of the ExpansionPanel](https://demos.telerik.com/{{ site.platform }}/expansionpanel/events).
The following example demonstrates how to subscribe to events by a handler name.
@(Html.Kendo().ExpansionPanel()
.Name("expanionpanel")
.Events(e => e.Expand("onExpand"))
... //Additional configuration
)
<script>
function onExpand(e){
// Handle the ExpansionPanel Expand event that triggers when it is expanded.
}
</script>
{% if site.core %}
<kendo-expansionpanel name="expanionpanel" on-expand="onExpand">
<!-- additional configuration -->
</kendo-expansionpanel>
<script>
function onExpand(e){
// Handle the ExpansionPanel Expand event that triggers when it is expanded.
}
</script>
{% endif %}
The following example demonstrates how to subscribe to events by a template delegate.
@(Html.Kendo().ExpansionPanel()
.Name("expanionpanel")
.Events(e => e.Expand(@<text>
function() {
// Handle the Expand event inline.
}
</text>)
)
... //Additional configuration
)
{% if site.core %}
<kendo-expansionpanel name="expanionpanel"
on-expand="function() {
// Handle the Expand event inline.
}">
</kendo-expansionpanel>
{% endif %}
- [Using the ExpansionPanel Events (Demo)](https://demos.telerik.com/{{ site.platform }}/expansionpanel/events)