The data payload type.
Applies a comparator function to sort the tree at all levels.
The comparator is applied recursively to root nodes and all descendants.
Pass null or undefined to clear the sort and restore the original
insertion order.
Applies a serializable sort expression to the tree.
The expression is compiled into a tree-node comparator that sorts by
node.data properties. Sorting is applied recursively at all levels.
Pass null to clear sorting and restore the original insertion order.
Sort criteria, or null to clear.
An in-memory tree datasource that supports sorting via a comparator function.
When a comparator is applied, the datasource re-derives its visible tree structure from the original data. Nodes are sorted at each level of the tree (root nodes and all children recursively). The underlying tree is never mutated.
Example