How do I prevent a PanelBar item from getting "k-state-selected"

2 Answers 359 Views
PanelBar
Michael
Top achievements
Rank 1
Veteran
Iron
Michael asked on 26 May 2021, 01:13 PM

I have a sidebar menu with a panelbar and i use the routerlink to navigate to components.

When i click a panelbar item the background changed - class k-state-selected was added. Can i prevent that?

2 Answers, 1 is accepted

Sort by
0
Accepted
Hetali
Telerik team
answered on 28 May 2021, 08:17 PM

Hi Michael,

Yes, by setting the selectable property of the PanelBarComponent to false, the class k-state-selected does not get added to the PanelBar item. For example:

<kendo-panelbar [selectable]="false">
  <kendo-panelbar-item [title]="'Communication'">
  </kendo-panelbar-item>
</kendo-panelbar>

In this StackBlitz example, the background of the PanelBar item does not change on click as it does not add the k-state-selected class.

I hope this helps. Let me know if I can further assist you.

Regards,
Hetali
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/.

0
Michael
Top achievements
Rank 1
Veteran
Iron
answered on 31 May 2021, 05:52 AM

Hi Hetali!

Thx for the example - [selectable] works!

Tags
PanelBar
Asked by
Michael
Top achievements
Rank 1
Veteran
Iron
Answers by
Hetali
Telerik team
Michael
Top achievements
Rank 1
Veteran
Iron
Share this question
or