Skip to main content
A grid groups by one column at a time. Every group gets a header row with its value, its row count and the footer aggregates for that group.

Grouping

setGroup(undefined) removes the group. Only columns whose type is groupable, and that do not set groupable: false, can be grouped. Date columns group into buckets. The granularity is part of the view, not of the query text.

Group order

When the sort includes the group column, groups follow that sort. Otherwise they follow option order for enums, natural order for other values, and newest first for dates. Empty values form one group, labelled Empty, which comes last. Click the chevron of a group to collapse it. Collapsed group keys are stored in collapsedGroups on the view, and toggleGroupCollapsed(key) changes them from code.

Aggregates

Each column type lists the aggregates it supports. See Column types. The footer shows one aggregate per column. Set it with the aggregate column option, from the Footer submenu of the column menu, or with grid.view.setFooter(column, fn). A date column with min or max shows the full range in the footer. Group rows show the same footer aggregates for their own rows, except count, which the group header already shows.
group.ts
Aggregate results are keyed column:fn, as aggregateKey({ column, fn }) builds them.

Without a grid

execute groups and aggregates an array directly.
execute.ts

Where it runs

The grid sends the group and the footer aggregates to the source when it has the group and aggregates capabilities. Otherwise it computes them over the rows it loaded. The Supabase adapter always computes them in the grid, since PostgREST has no grouping. With offset pagination, a page holds groups rather than rows, and the pager counts groups.
The SQL adapters cut group summaries to maxGroups, 1000 by default. Pages past that limit are empty. Raise it in Node or Laravel when a column has more distinct values.