Server-Side Row Model - Row Grouping
Summary
- Row Grouping is available in AdapTable when using the Server-Side Row Model
- The data needs to be grouped on the server and passed to the client to display
AdapTable fully supports Row Grouping when using the Server Side Row Model.
Nothing additional needs to be added, on the AdapTable side, to that which is provided in AG Grid's Server-Side architecture.
Note
In other words the rowGroupCols and groupKeys props in IServerSideGetRowsParams are sufficient on their own
- This example shows a grid using Server-Side Row Model with two Layouts:
- Single Group Layout — grouped by
Athlete - Multi Group Layout — grouped by
CountrythenAthlete, withRowGroupDisplayType: 'multi'
- Single Group Layout — grouped by
- The grouping is evaluated on the Server and sent to the client to be rendered
- Start on Single Group Layout and expand an athlete to see their medal rows
- Switch to Multi Group Layout in the Layout toolbar, then expand a country and an athlete
Expanding and Collapsing Row Groups
A Layout's Row Group expansion (RowGroupValues) works with the Server-Side Row Model.
RowGroupDefaultBehavior: 'always-expanded' (and 'always-collapsed') also applies to Row Groups which have not been loaded from the server yet.
Note
AdapTable sets AG Grid's ssrmExpandAllAffectsAllRows to true when using the Server-Side Row Model, unless it is set in Grid Options
Caution
- If
ssrmExpandAllAffectsAllRowsis set tofalse, an'always-expanded'Layout only expands the Row Groups which are already loaded - In a Master Detail grid, an
'always-expanded'Layout (andgridApi.expandAllRowGroups()) also expands the Master rows
Grand Total Row
A Layout's Grand Total Row (GrandTotalRow) works with the Server-Side Row Model.
The server provides the totals: when needsGrandTotal is true in IServerSideGetRowsParams, return them as grandTotalData in the success callback (see AG Grid SSRM Grand Total Row).
Note
Format Columns are applied to the Grand Total Row, unless their RowScope has ExcludeTotalRows: true