DevExtreme v24.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React Tree List - Multiple Sorting

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.

To give you the ability to edit code on the fly, the demo uses SystemJS. For this reason, launching the demo takes some time. We strongly recommend that you do not use this approach in real projects.
Backend API

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.

To specify the initial sort settings, use the column's sortOrder and sortIndex properties.