The TreeList component can sort values by a single or multiple columns. Use the sorting.mode property to specify the sort mode:
Single sort mode
A user can click the column header to sort by this column and click it again to change the sort order. An arrow icon in the column's header indicates the sort order.
Multiple sort mode
A user can hold the Shift key and click column headers in the order the user wants to apply sorting. A number in the column's header indicates the sort index. To cancel a column's sort settings, a user should hold the Ctrl key and click the column header.
A user can also apply or cancel sort settings in the column header's context menu. To disallow a user to sort by a particular column, set the column's allowSorting property to false.