LyteNyte Grid logo for light mode. Links back to the documentation home page.
Tree Data

Tree Filtering

Filter tree rows by passing a predicate function to the tree data source. The predicate runs for each row and determines whether the grid includes it.

Filtering Tree Rows

Set the filter property on the useTreeDataSource hook to filter rows created from the object provided to the data property of the tree data source.

The filter property accepts a predicate function that receives each value from the object provided to data. If the function returns true, the value and any of its children are kept; otherwise, they are removed.

In this demo, hidden files are defined as files whose names start with a ., like .env. Use the Reveal Hidden Files switch to toggle their visibility.

Tree Row Filtering

Fork code on stack blitzFork code on code sandbox

Next Steps

  • Tree Sorting: Sort tree rows in ascending or descending order.
  • Tree Data: Generate hierarchical rows from nested object data.
  • Tree Editing: Edit tree data nodes using LyteNyte Grid's cell editing capabilities.