Grouping rows by common field values
With RowGroup, a DataTables View puts the rows that share a value in one field, such as a city, together, and shows that value in a row of its own above each group.

Turning on RowGroup #
- Edit the View and click the DataTables tab in the Settings box.
- Under RowGroup, turn on Enable RowGroup Tables.
- In Choose a field to row group, choose the field. The list shows the fields the table has as columns.
- Under Row Group Position, choose where the row with the group’s name goes: Start of the group, which is on by default, End of the group, or both.
- In Choose the direction of the grouping row, choose ASC to put the groups in ascending order or DESC for descending.
- Click Update.

Sorting a grouped table #
The rows stay in their groups when a visitor sorts the table. Clicking another column’s heading sorts the rows inside each group, and clicking the grouping column’s heading twice puts the groups in reverse order. Both processing modes, Ajax (Server-side) and Preloaded (Client-side), work this way.
Things to know #
- Turn off Scroller when you use RowGroup. With both on, the rows on screen after scrolling don’t match the count under the table: it can say “Showing 101 to 109 of 200 entries” over rows 98 to 105.
- The export buttons leave out the group rows. A CSV file lists the entries in their group order, each with its own value in the grouping column.
Table Of Contents