# EditOptions (@salmonui/data-grid/engine)

> The EditOptions interface of @salmonui/data-grid/engine.

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

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

Also exported from `@salmonui/data-grid/engine/edit`.

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

## Reference

Kind: interface

```ts
interface EditOptions<Row = unknown> {
    readonly enabled?: boolean;
    readonly edit?: boolean;
    readonly add?: boolean;
    readonly delete?: boolean;
    readonly mode?: EditMode;
    readonly newRowPosition?: NewRowPosition;
    readonly showNewRow?: boolean;
    readonly tabToNextRow?: boolean;
    readonly isCellEditable?: (ctx: EditCellContext<Row>) => boolean;
    readonly validateRow?: RowValidator<Row>;
    readonly messages?: Partial<EditMessageTable>;
    readonly newRow?: () => Partial<Row>;
    readonly undo?: boolean;
    readonly undoLimit?: number;
    readonly keyedRows?: boolean;
}
```

Members (15):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled?: boolean;` | optional | Default true. |
| `edit` | `readonly edit?: boolean;` | optional | Existing rows can be edited. Default true. |
| `add` | `readonly add?: boolean;` | optional | Rows can be added. Default true. |
| `delete` | `readonly delete?: boolean;` | optional | Rows can be deleted. Default true. |
| `mode` | `readonly mode?: EditMode;` | optional | `row` is inline row editing. Default `row`. |
| `newRowPosition` | `readonly newRowPosition?: NewRowPosition;` | optional | Where added rows appear. Default `top`. Tree mode: `above` / `below` the focused row as its sibling, or as its last `child`; the added row carries its `parentId` in `WriteRequest.added`. |
| `showNewRow` | `readonly showNewRow?: boolean;` | optional | An always-visible blank add row at `newRowPosition`; row mode only. Saving it writes the record and shows a fresh blank row. Default false. |
| `tabToNextRow` | `readonly tabToNextRow?: boolean;` | optional | Tab from the last editable cell continues in the next row. Default true in batch and cell mode, false otherwise. |
| `isCellEditable` | `readonly isCellEditable?: (ctx: EditCellContext<Row>) => boolean;` | optional | Extra per-cell policy (`canEditCell`); column and row rules apply first. |
| `validateRow` | `readonly validateRow?: RowValidator<Row>;` | optional | Row-level validation before a row (or batch) commits; may be async. |
| `messages` | `readonly messages?: Partial<EditMessageTable>;` | optional | Validation and save / conflict message overrides (`EditMessages`). |
| `newRow` | `readonly newRow?: () => Partial<Row>;` | optional | Initial values of an added row, merged over the columns' `defaultValue`. |
| `undo` | `readonly undo?: boolean;` | optional | Records an undo history. Default false: nothing is recorded. |
| `undoLimit` | `readonly undoLimit?: number;` | optional | Maximum undo entries kept (oldest dropped first). Default 10. |
| `keyedRows` | `readonly keyedRows?: boolean;` | optional | `getRowId` is the application's own key (a renderer passes true when the app set `getRowId`), so rows are addressable without a `primaryKey` column and `edit-no-primary-key` is not reported. Default false. |
