Multi-sorting columns in DataTables
To sort a DataTables View by more than one column, hold down Shift while you click the next column’s heading. The table sorts by the first column, and rows with the same value there sort by the next one.
- Click the heading of the first column, such as City.
- Hold down Shift and click the heading of the next column, such as Hours. Shift-click more headings to add more columns.

Shift-click a heading that is already part of the sort to switch that column from ascending to descending. A Shift-click on a column that is already descending takes it out of the sort, as long as another column still sorts the table.
Clicking a heading without Shift starts over with that column alone. This works the same way in both processing modes, Ajax (Server-side) and Preloaded (Client-side).
When the View sorts by a field the table doesn’t show, the first Shift-click replaces that hidden sort with the column you click. If the View’s Sort by secondary field is a column the table shows, that column stays first and the clicked column comes after it. Hold down Shift and click more headings to add their columns, as above.
Opening the table sorted by two fields #
To open the table already sorted by two fields, set Sort by field and Sort by secondary field on the Filter & Sort tab of the View editor. How a DataTables View sorts its entries covers the order a table opens in, and Sorting by multiple columns covers the same settings for the Table layout.