How to expand all nodes by default in treeList in react?
Can anyone give example how to achieve this?
1 Answer, 1 is accepted
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: