Example of Sorting API in React Tree Grid Component

/
/
SortingAPI

Sorting feature enables us to order the data in a particular direction. It can be enabled by setting the allowSorting as true.

More Details...

1
Planning
5100
2
Plan timeline
5100
3
Plan budget
5100
4
Allocate resources
5100
5
Planning complete
00
6
Design
386
7
Software Specification
360
8
Develop prototype
3100
9
Get approval from customer
2100
10
Design Documentation
2100
11
Design complete
00
12
Implementation Phase
1166
13
Phase 1
1150
14
Implementation Module 1
1110
15
Development Task 1
350
16
Development Task 2
350
17
Testing
20
18
Bug fix
20
19
Customer review meeting
20
20
Phase 1 complete
050
21
Phase 2
1260
22
Implementation Module 2
1290
23
Development Task 1
450
24
Development Task 2
450
25
Testing
20
26
Bug fix
20
27
Customer review meeting
20
28
Phase 2 complete
050
29
Phase 3
1130
30
Implementation Module 3
1160
31
Development Task 1
350
32
Development Task 2
350
33
Testing
20
34
Bug fix
20
35
Customer review meeting
20
36
Phase 3 complete
050
Properties
Column
Direction
Description

Sorting feature enables us to order the data in a particular direction. It can be enabled by setting the allowSorting as true.

To sort a Tree Grid column simply click the column header. The icons (ascending) and (descending) specifies the sort direction of a column.

By default, multi-sorting is enabled in Tree Grid, to sort multiple column hold CTRL key and click the column header. To clear sort for a column, hold SHIFT key and click the column header.

While using Tree Grid in a touch device, you have an option for multi sorting in single tap on the Tree Grid header. By tapping on the Tree Grid header, it will show the toggle button in small popup with sort icon. Now tap the button to enable the multi-sorting in single tap.

In this demo, select the column and direction from the properties panel then click the Sort button. Use the Clear button to remove sort for the selected column.

Injecting Module:

Tree Grid features are segregated into individual feature-wise modules. To use sorting feature, we need to inject Sort module into the services.

More information on the sorting feature configuration can be found in this documentation section.