Kendo React PanelBar - expanded prop should collapse and expand items automatically when navigating to a different route through the content link

1 Answer 69 Views
PanelBar
Jason
Top achievements
Rank 2
Iron
Iron
Iron
Jason asked on 14 Feb 2023, 02:42 PM

Greetings,

I'm currently using the PanelBar with expandMode="single" and I'm trying to set the expanded prop to be dynamic (able to collapse and expand on its own when navigating to a different route through the content link).

When I try to navigate to a different route through the content link, only the selected prop is re-rendered but the expanded prop still stays on the previous route.

Is there a solution for this? Thank you!

Best Regards,

Jason Li

1 Answer, 1 is accepted

Sort by
1
Accepted
Filip
Telerik team
answered on 16 Feb 2023, 12:37 PM

Hi, Jason,

In order to implement this, I can recommend setting the component in control mode and changing the expandMode dynamically on the onSelect event.

More information on control mode can be found here:

https://www.telerik.com/kendo-react-ui/components/layout/panelbar/controlled-mode/

In case you are still experiencing difficulties with the implementation can you provide a runnable sample that reproduces this behavior so that I can investigate further?

Regards,
Filip
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
PanelBar
Asked by
Jason
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Filip
Telerik team
Share this question
or