Tree Grid
Displays a hierarchical view of data in a table. This component requires API version 42.0 and later.
Descriptor
lightning:treeGridTargets
Lightning Experience, Experience Builder Sites, Lightning Out / Visualforce, Standalone Lightning App
Example Options
Base Tree GridA tree grid displays structured data in a table with expandable rows. Tree Grid With Expanded RowsRetrieve expanded row names with the getCurrentExpandedRows method. Asynchronous Loading of Nested ItemsFor improved performance, a tree grid can load content only when the rows expand.
Base Tree Grid
Code
<aura:component> <aura:handler name="init" value="{!this}" action="{!c.init}" /> <aura:attribute name="gridColumns" type="List" access="PRIVATE" /> <aura:attribute name="gridData" type="Object" access="PRIVATE" /> <aura:attribute name="gridExpandedRows" type="List" access="PRIVATE" /> <div> <lightning:treeGrid columns="{! v.gridColumns }" data="{! v.gridData }" expandedRows="{! v.gridExpandedRows }" keyField="name" /> </div> </aura:component>