API reference: @salmonui/data-grid
DataGridSaveEventinterface
import type { DataGridSaveEvent } from '@salmonui/data-grid';interface DataGridSaveEvent<Row> extends DataGridEvent {
readonly mode: EditMode;
readonly added: readonly RowId[];
readonly changed: readonly {
readonly rowId: RowId;
readonly fields: readonly string[];
}[];
readonly deleted: readonly RowId[];
rows(): EditBatchChanges<Row>;
readonly status: DataGridSaveStatus;
readonly result: WriteResult<Row> | null;
readonly error: Error | null;
readonly failedRowIds: readonly RowId[];
}
onBeforeSave (before the write is sent; cancellable) / onSave (after
the write settled). Lists are computed on first read.
| Name | Signature | Description |
|---|---|---|
mode | readonly mode: EditMode; | |
added | readonly added: readonly RowId[]; | |
changed | readonly changed: readonly {
readonly rowId: RowId;
readonly fields: readonly string[];
}[]; | |
deleted | readonly deleted: readonly RowId[]; | |
rows | rows(): EditBatchChanges<Row>; | The rows with drafts applied (before-event); the rows written, with the source's echo where it sent one (after-event). |
status | readonly status: DataGridSaveStatus; |
|
result | readonly result: WriteResult<Row> | null; | The data source's write result (after-event), else null. |
error | readonly error: Error | null; | The error a failed write threw (status |
failedRowIds | readonly failedRowIds: readonly RowId[]; | Rows the write did not apply (row or cell errors, conflicts, rejection); they keep their drafts. |
typeinherited | type: string; |
|
sourceinherited | source: DataGridEventSource; | |
defaultPreventedinherited | defaultPrevented: boolean; | True after |
preventDefaultinherited | preventDefault: () => void; | Before-events and click events: cancels the action (or the built-in behavior). |