# PivotModelChangeEvent (@salmonui/pivot-table)

> The PivotModelChangeEvent interface of @salmonui/pivot-table: onBeforePivotModelChange / onPivotModelChange.

Canonical: https://salmonui.dev/docs/reference/pivot-table/PivotModelChangeEvent

```ts
import type { PivotModelChangeEvent } from '@salmonui/pivot-table';
```

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

## Reference

Kind: interface

```ts
interface PivotModelChangeEvent extends PivotEvent {
    readonly action: PivotAction;
    readonly model: PivotModel;
    readonly previousModel: PivotModel;
    readonly field: string | null;
}
```

`onBeforePivotModelChange` / `onPivotModelChange`.

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `action` | `readonly action: PivotAction;` |  |  |
| `model` | `readonly model: PivotModel;` |  | The model proposed (before) or applied (after). |
| `previousModel` | `readonly previousModel: PivotModel;` |  |  |
| `field` | `readonly field: string \| null;` |  | Field the action is about, or null. |
| `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). |
