Expand Expansion Panel using jquery

1 Answer 170 Views
ExpansionPanel
Prabhat
Top achievements
Rank 1
Prabhat asked on 31 May 2022, 07:38 PM
I am using Kendo for ASP.NET Core. I have a bunch of expansion panels implemented on my screen. I want to be able to expand or collapse them using jquery. I am able to reference them using ("selector").data("kendoExpansionPanel") but I don't know which method would help me be able to expand or collapse them. Any help would be appreciated.

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 03 Jun 2022, 12:06 PM

Hello Prabhat,

Indeed, you could use the client-side toggle() method to expand/collapse the appropriate ExpansionPanel component:

@(Html.Kendo().ExpansionPanel()
  .Name("panel1")
  ...
)

<script>
$(document).ready(function() {
        $("#panel1").data("kendoExpansionPanel").toggle(); //The ExpansionPanel will expand or collapse based on its current state.
});
</script>

Here is a REPL example for your reference:

https://netcorerepl.telerik.com/GcYgERlc01GTlRbh57

If any questions arise, feel free to share them.

 

Regards, Mihaela Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ExpansionPanel
Asked by
Prabhat
Top achievements
Rank 1
Answers by
Mihaela
Telerik team
Share this question
or