ExpansionPanel: Expand and Collapse event - get reference to sender

1 Answer 117 Views
ExpansionPanel
Mikko
Top achievements
Rank 1
Mikko asked on 10 Feb 2023, 11:48 AM

Hello,

What is correct way to get ExpansionPanel's name that caused expand/collapse event? I would like to create general method to save expand panels expanded states.

By trial and error I have discovered that both expand and collapse event handlers seem to get some argument. This is argument is undocumented. My tests show that I can get ExpansionPanel name following way:

    function expand(e){
        var expandPanelName=$(e.item).attr("name");
        console.log(expandPanelName);
    }

Is this correct way to do it or can this be changed in future versions of Kendo?

Thanks
Mikko

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 14 Feb 2023, 10:56 AM

Hello Mikko,

Indeed, this is the correct way to get the name of the ExpansionPanel that is expanded/collapsed. Here is a REPL sample that demonstrates it:

https://netcorerepl.telerik.com/QHYwlSbO485M7gls35

Both events provide the following event data:

  • item - The ExpansionPanel HTML element.
  • sender - The ExpansionPanel instance which fired the event.

We will update both server-side and client-side APIs with this information.

If any questions arise, please let me know.

 

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
Mikko
Top achievements
Rank 1
Answers by
Mihaela
Telerik team
Share this question
or