TreeList-expand all nodes

1 Answer 185 Views
Data Query TreeList
A
Top achievements
Rank 1
Iron
Iron
A asked on 14 Oct 2022, 01:29 PM

Hi,

How to expand all nodes by default in treeList in react?

Can anyone give example how to achieve this?

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 16 Oct 2022, 06:43 PM

Hello,

The TreeList has "expandField" property that can be set to the field that will indicate if an item is expanded or not. If the value of that field is true initially for all items, all nodes will be expanded.

Our demos demonstrate how to use external state variable for storing the expanded state, so if that approach is used, you can include all items to that state initially. Here is an example demonstrating such implementation:

There is also an external button that can also be used for expanding all nodes. 

Hope this helps.

 

Regards,
Konstantin Dikov
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
Data Query TreeList
Asked by
A
Top achievements
Rank 1
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or