# DataGridEditing (@salmonui/data-grid)

> The DataGridEditing interface of @salmonui/data-grid: editing prop.

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

```ts
import type { DataGridEditing } 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 DataGridEditing<Row = unknown> {
    readonly edit?: boolean;
    readonly add?: boolean;
    readonly delete?: boolean;
    readonly mode?: EditMode;
    readonly newRowPosition?: 'top' | 'bottom' | 'above' | 'below' | 'child';
    readonly showNewRow?: boolean;
    readonly editOnDoubleClick?: boolean;
    readonly confirmSave?: boolean;
    readonly confirmDiscard?: boolean;
    readonly confirmDelete?: boolean;
    readonly tabToNextRow?: boolean;
    readonly undo?: boolean;
    readonly undoLimit?: number;
    readonly fillHandle?: boolean;
    readonly guardUnsaved?: boolean | readonly DataGridGuardedAction[];
    readonly isCellEditable?: (ctx: EditCellContext<Row>) => boolean;
    readonly validateRow?: RowValidator<Row>;
    readonly newRow?: () => Partial<Row>;
    readonly dialogProps?: DataGridDialogProps;
    readonly renderDialog?: (ctx: DataGridDialogContext<Row>) => ReactNode;
    readonly renderDialogHeader?: (ctx: DataGridDialogContext<Row>) => ReactNode;
    readonly renderDialogFooter?: (ctx: DataGridDialogContext<Row>) => ReactNode;
}
```

`editing` prop.

Members (22):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `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` (inline row form), `dialog`, `batch`, or `cell` (Salmon: one-cell commits). Default `row`. Initial only. |
| `newRowPosition` | `readonly newRowPosition?: 'top' \| 'bottom' \| 'above' \| 'below' \| 'child';` | optional | Where added rows appear. Default `top`. Tree mode adds `above`, `below` and `child`, relative to the focused row. |
| `showNewRow` | `readonly showNewRow?: boolean;` | optional | An always-visible blank add row at `newRowPosition`. Enter (or Save) writes it and a fresh blank row follows; Escape clears it; its editors are disabled while another row edits. Row mode only. Default false. |
| `editOnDoubleClick` | `readonly editOnDoubleClick?: boolean;` | optional | Double click starts editing. Default true. |
| `confirmSave` | `readonly confirmSave?: boolean;` | optional | Ask before saving a batch from the toolbar or a menu. `api.save()` never asks. Default true. |
| `confirmDiscard` | `readonly confirmDiscard?: boolean;` | optional | Ask before discarding unsaved batch changes (batch cancel, guarded actions). Default true. |
| `confirmDelete` | `readonly confirmDelete?: boolean;` | optional | Ask before deleting rows from the keyboard, toolbar, menus, or command buttons. 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. |
| `undo` | `readonly undo?: boolean;` | optional | Undo and redo of edits (Mod+Z, Mod+Y). Default false. |
| `undoLimit` | `readonly undoLimit?: number;` | optional | Undo history depth. Default 10. |
| `fillHandle` | `readonly fillHandle?: boolean;` | optional | Spreadsheet fill handle: a square at the bottom-right of the selected cell range; dragging it down, up, left or right tiles the range over the extended range (`onBeforeFill`). Default false. Needs `selection.mode` `cell` or `both`. |
| `guardUnsaved` | `readonly guardUnsaved?: boolean \| readonly DataGridGuardedAction[];` | optional | Intercept query actions while there are unsaved changes: `true` guards sorting, filtering, searching, paging, and grouping; a list guards those actions only. The action runs after the changes are discarded (with a `confirmDiscard` prompt). Also warns on page unload. Default: true in batch mode. |
| `isCellEditable` | `readonly isCellEditable?: (ctx: EditCellContext<Row>) => boolean;` | optional | Extra per-cell edit policy. |
| `validateRow` | `readonly validateRow?: RowValidator<Row>;` | optional | Row-level validation before a row (or batch) saves; may be async. |
| `newRow` | `readonly newRow?: () => Partial<Row>;` | optional | Values of an added row, merged over the columns' `defaultValue`. |
| `dialogProps` | `readonly dialogProps?: DataGridDialogProps;` | optional | Built-in dialog settings. |
| `renderDialog` | `readonly renderDialog?: (ctx: DataGridDialogContext<Row>) => ReactNode;` | optional | Replaces the dialog form body. |
| `renderDialogHeader` | `readonly renderDialogHeader?: (ctx: DataGridDialogContext<Row>) => ReactNode;` | optional |  |
| `renderDialogFooter` | `readonly renderDialogFooter?: (ctx: DataGridDialogContext<Row>) => ReactNode;` | optional |  |
