Skip to content

Latest commit

 

History

History
81 lines (64 loc) · 2.29 KB

File metadata and controls

81 lines (64 loc) · 2.29 KB
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

Events

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).

Handling by Handler Name

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 %}

Handling by Template Delegate

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 %}

Next Steps

See Also