This is a migrated thread and some comments may be shown as answers.

Kendo React PanelBar, Routing and selection not working

2 Answers 357 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 03 Sep 2018, 03:15 PM

Hi all

I'm using the React Panelbar together with the React router, something like

<PanelBar expandMode={'multiple'} onSelect={this.onSelect}>
    <PanelBarItem title='Overall views' route="/monitoring/overview" expanded={true}>
        <PanelBarItem id='overviewLink' title='All Resources' route="/monitoring/overview"/>
        <PanelBarItem id='appmonitorLink' title={'AppMonitor'} route="/monitoring/appmonitor"/>
    </PanelBarItem>

This all works nicely, when clicking the respective items in the PanelBar, the application is routed accordingly.

But when I navigate directly to a specific URL (e.g. via a button/selectable item in the application, or via the browser Back button), the selected item in the PanelBar is not correctly updated. The selection either stays with the last clicked PanelBarItem, or simply no item is selected. The routing in the application itsself works as expected.

Is there somewhere an example what I need to do to keep the selected PanelBarItem in sync with the application state?

BTW: When using https://www.telerik.com/kendo-react-ui/components/layout/panelbar/routing/ clicking different PanelBarItems and then browser Back, it shows the same behaviour. Application state is updated correctly, but the wrong PanelBarItem remains selected

Thanks for any hints!

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 04 Sep 2018, 07:25 AM
Hello, Joe,

Thank you for the details.

Based on them I can assume that this is the same issue as the one discusses here:

https://github.com/telerik/kendo-react/issues/57

We already provided an example(workaround) for this cases and keep the issue open for discussion.

Please share your feedback inside the GitHub issue as this will help us decide how to proceed with this.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Joe
Top achievements
Rank 1
answered on 04 Sep 2018, 08:49 AM

Hi Stefan

yes, of course you're right. It's the same issue and the same workaround also works for me!

Apologies for not searching deep enough for an answer, and thanks for your help!

CU, Joe

Tags
General Discussions
Asked by
Joe
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Joe
Top achievements
Rank 1
Share this question
or