Users name the columns to group by, and the plugin sets the table's grouping, one level per column. It groups rows; it does not add totals.
Group the tickets by team
group Teamgroup by country
group Countryimport { assistantGroupedRowModel } from '@gridsay/tanstack-table/react';import { columnGroupingFeature, createExpandedRowModel, rowExpandingFeature, rowSelectionFeature, tableFeatures,} from '@tanstack/react-table'; export const features = tableFeatures({ columnGroupingFeature, groupedRowModel: assistantGroupedRowModel(), rowExpandingFeature, expandedRowModel: createExpandedRowModel(), rowSelectionFeature,});columnGroupingFeature, with assistantGroupedRowModel() as the groupedRowModel, in place of TanStack's createGroupedRowModel(). With TanStack's own grouped row model, the assistant is told grouping is off.rowExpandingFeature and expandedRowModel, so the rows inside each group can show. Set initialState: { expanded: true } and autoResetExpanded: false on the table to keep groups open after the next answer.manualGrouping: true, when your server groups. Then the plugin only sets the grouping state; see Server-side data.Render group rows with row.getIsGrouped(), as the quickstart does. A count such as row.getLeafRows().length is your own code, not an answer.
assistantGroupedRowModel() takes no options and follows the table's grouping state:
A column with enableGrouping: false cannot be grouped by the assistant.
The plugin tells Gridsay that totals, pivots and charts are switched off, on every table, whether or not it is grouped. A question that needs one is declined:
show the total of the orders for each country
Totals per country need aggregation, which is turned off for this grid.
Your user reads this sentence. The table stays as it was.pivot the orders: countries as columns, statuses as rows
Pivoting is disabled on this grid, so I can't build that cross-tab.
Your user reads this sentence. The table stays as it was.The sentence is usually the assistant's own, as in these two. Only if the model's answer still uses one of them after Gridsay asks it to correct the answer does the user see a fixed sentence:
| Asked for | Sentence |
|---|---|
| Totals | "Totals are switched off for this table." |
| A pivot | "Pivoting is switched off for this table." |
| A chart | "This table has no chart." |
ask resolves false, the table stays as it was, and a declined question is charged. See Refusals and errors.