Angular Hierarchical Drawer Expand/collapse all items

0 Answers 70 Views
Drawer
Amr
Top achievements
Rank 1
Amr asked on 15 Nov 2022, 12:14 PM
Hello,

I'm using the Angular Hierarchical Drawer and I added a toggle button to expand/ collapse all items.

How can I expand/ collapse the items in the drawer using this toggle button?

Thanks
Georgi
Telerik team
commented on 17 Nov 2022, 04:12 PM

Hello Amr, 

One possible way to achieve the desired functionality is with the use of the isItemsExpanded property of the Drawer component.

Below, I am sending you a StackBlitz demo, which demonstrates how the callback can be used to toggle all levels of the Drawer using a custom button.

StackBlitz demo:

https://stackblitz.com/edit/angular-gwxcc6-qdegce?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp_styles.css

It is worth mentioning that the implementation of such functionality relies on custom logic that needs to be further adjusted by the developer in order to fit the exact project requirements (like toggling all levels and then collapsing them manually with the cursor). Please keep in mind that any further modifications in that direction should be in the hands of the developer.

I hope this works for you. 

Regards,

Georgi

Progress Telerik

No answers yet. Maybe you can help?

Tags
Drawer
Asked by
Amr
Top achievements
Rank 1
Share this question
or