# DataGridGroupToggleEvent (@salmonui/data-grid)

> The DataGridGroupToggleEvent interface of @salmonui/data-grid: onBeforeGroupToggle / onGroupToggle (lazy and eager groups).

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

```ts
import type { DataGridGroupToggleEvent } 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 DataGridGroupToggleEvent<Row> extends DataGridEvent {
    readonly groupId: RowId;
    readonly path: readonly GroupPathSegment[];
    readonly key: GroupRowSnapshot['key'];
    readonly expanded: boolean;
    readonly lazy: boolean;
    rows(): readonly Row[];
}
```

`onBeforeGroupToggle` / `onGroupToggle` (lazy and eager groups).

Members (10):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `groupId` | `readonly groupId: RowId;` |  |  |
| `path` | `readonly path: readonly GroupPathSegment[];` |  |  |
| `key` | `readonly key: GroupRowSnapshot['key'];` |  |  |
| `expanded` | `readonly expanded: boolean;` |  | The state after the toggle (proposed in the before-event). |
| `lazy` | `readonly lazy: boolean;` |  | True in lazy mode. |
| `rows` | `rows(): readonly Row[];` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |
