Sorting Tree Data Hierarchically
For tree data, sorting reorders siblings within each parent and never moves a child to a different parent. Optional rules keep folders before files, or apply the sort to selected levels only.
Planned. This page shows the specification from issue #186. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A file-system tree four levels deep with Name and Size columns.
Expected behavior
Sorting by Size orders the siblings inside each folder. With foldersFirst on, folders stay above files at every level. Parent and child relationships and expansion state are never changed.
Planned API surface
treeDatagetDataPathtreeSortLevelsfoldersFirstisGroupNodeAcceptance criteria
- After sorting, every node has the same parent it had before (pending)
- Siblings are sorted with the active sortModel (pending)
- foldersFirst partitions the siblings before sorting (pending)
- Levels excluded by treeSortLevels keep their base order (pending)