Server-Side Row Model - Row Grouping

View as Markdown

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

SSRM - Row Grouping
Fork
  • This example shows a grid using Server-Side Row Model with two Layouts:
    • Single Group Layout — grouped by Athlete
    • Multi Group Layout — grouped by Country then Athlete, with RowGroupDisplayType: 'multi'
  • The grouping is evaluated on the Server and sent to the client to be rendered
Try It Out
  • 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
Loading demo…

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 ssrmExpandAllAffectsAllRows is set to false, an 'always-expanded' Layout only expands the Row Groups which are already loaded
  • In a Master Detail grid, an 'always-expanded' Layout (and gridApi.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