API reference: @salmonui/data-grid
DataGridApiEnginetype
import type { DataGridApiEngine } from '@salmonui/data-grid';type DataGridApiEngine<Row = unknown> = DataGridEngine<Row> & {
readonly infiniteScroll?: DataGridInfiniteScrollFacade<Row>;
};
api.engine: the engine plus the façades of optional modules registered by props.
| Name | Signature | Description |
|---|---|---|
idinherited | id: string; | |
getSnapshotinherited | getSnapshot: () => DataGridSnapshot<Row>; | |
getServerSnapshotinherited | getServerSnapshot: () => DataGridSnapshot<Row>; | |
subscribeinherited | subscribe: (listener: () => void) => () => void; | |
selectinherited | select: <T>(selector: (snapshot: DataGridSnapshot<Row>) => T) => T; | |
subscribeSelectorinherited | subscribeSelector: <T>(selector: (snapshot: DataGridSnapshot<Row>) => T, listener: (value: T) => void, isEqual?: ((a: T, b: T) => boolean) | undefined) => () => void; | |
subscribeCellinherited | subscribeCell: (rowId: string, columnId: string, listener: () => void) => () => void; | |
subscribeRowinherited | subscribeRow: (rowId: string, listener: () => void) => () => void; | |
subscribeHeaderinherited | subscribeHeader: (columnId: string, listener: () => void) => () => void; | |
subscribeModuleinherited | subscribeModule: (name: string, listener: () => void) => () => void; | |
getCellSnapshotinherited | getCellSnapshot: (rowId: string, columnId: string) => CellSnapshot | undefined; | |
getRowSnapshotinherited | getRowSnapshot: (rowId: string) => RowSnapshot<Row> | undefined; | |
getHeaderSnapshotinherited | getHeaderSnapshot: (columnId: string) => HeaderSnapshot | undefined; | |
getModuleStateinherited | getModuleState: <T = unknown>(name: string) => T | undefined; | |
getSelectorinherited | getSelector: (moduleName: string, selectorName: string) => ((snapshot: DataGridSnapshot<Row>) => unknown) | undefined; | |
getRowinherited | getRow: (rowId: string) => Row | undefined; | Raw row by id (source rows, including rows filtered out of the view). |
getRowIndexinherited | getRowIndex: (rowId: string) => number; | Visible index of a row, or -1. |
getRowAtinherited | getRowAt: (index: number) => Row | undefined; | |
getRowIdAtinherited | getRowIdAt: (index: number) => string | undefined; | |
getCellValueinherited | getCellValue: (rowId: string, columnId: string) => unknown; | |
getDataSourceinherited | getDataSource: () => DataSource<Row>; | |
setColumnsinherited | setColumns: (columns: readonly ColumnDef<Row>[]) => void; | Recompiles only when the array identity or a definition identity changes. |
setLocaleinherited | setLocale: (next: { readonly locale?: string; readonly currency?: string; readonly timeZone?: string | undefined; readonly direction?: "ltr" | "rtl"; }) => boolean; | Changes the locale, currency, time zone, or direction at runtime. A format change recompiles the column formatters once
and re-runs the pipeline (collation follows the locale); a direction
change updates |
dispatchinherited | dispatch: (command: DataGridCommand) => CommandResult; | |
hasCommandinherited | hasCommand: (type: string) => boolean; | Whether a registered module declares the command type (UI commands probe it before dispatching). |
batchinherited | batch: (run: () => void) => void; | |
onBeforeCommandinherited | onBeforeCommand: (listener: (event: BeforeCommandEvent) => void | string | boolean) => () => void; | |
onCommandinherited | onCommand: (listener: (event: CommandEvent) => void) => () => void; | |
getCommandLoginherited | getCommandLog: () => readonly DataGridCommand[]; | |
getInstrumentationinherited | getInstrumentation: () => DataGridInstrumentation | null; | |
connectinherited | connect: () => () => void; | With |
reloadinherited | reload: () => void; | Re-reads the data source with the current query (retry after a data error). Before |
refreshinherited | refresh: () => void; | Refresh: drops the row and cell snapshot caches,
invalidates the source cache ( |
disposedinherited | disposed: boolean; | |
disposeinherited | dispose: () => void; | |
infiniteScrolloptionalinherited | infiniteScroll?: DataGridInfiniteScrollFacade<Row>; | Present with the |