# DataGridAggregateContext (@salmonui/data-grid)

> The DataGridAggregateContext interface of @salmonui/data-grid: Context of aggregate templates (renderFooter, renderGroupFooter, renderGroupCaption).

Canonical: https://salmonui.dev/docs/reference/data-grid/DataGridAggregateContext

```ts
import type { DataGridAggregateContext } from '@salmonui/data-grid';
```

Entry index: https://salmonui.dev/docs/reference/data-grid (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid.md).

## Reference

Kind: interface

```ts
interface DataGridAggregateContext<Row> {
    readonly field: string;
    readonly column: DataGridColumnInfo<Row> | undefined;
    readonly values: Readonly<Record<string, unknown>>;
    readonly formatted: Readonly<Record<string, string>>;
    readonly group: GroupRowSnapshot | null;
    readonly key: GroupRowSnapshot['key'] | null;
    readonly count: number;
    readonly aggregates: AggregateValues;
    readonly rows: () => readonly Row[];
}
```

Context of aggregate templates (`renderFooter`, `renderGroupFooter`, `renderGroupCaption`).

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field: string;` |  |  |
| `column` | `readonly column: DataGridColumnInfo<Row> \| undefined;` |  |  |
| `values` | `readonly values: Readonly<Record<string, unknown>>;` |  | Values of this column's aggregates by type (`{ sum, average }`). |
| `formatted` | `readonly formatted: Readonly<Record<string, string>>;` |  | Formatted values by type. |
| `group` | `readonly group: GroupRowSnapshot \| null;` |  | The group for group footers and captions; null in the grid footer. |
| `key` | `readonly key: GroupRowSnapshot['key'] \| null;` |  | `key` and `count` of the group. In the grid footer: null and the data rows the values cover (the page for `aggregateScope: 'page'`, every matching row for `'all'` or server aggregates). |
| `count` | `readonly count: number;` |  |  |
| `aggregates` | `readonly aggregates: AggregateValues;` |  | Every aggregate of the group or grid. |
| `rows` | `readonly rows: () => readonly Row[];` |  |  |
