API reference: @salmonui/data-grid
DataGridViewApiinterface
import type { DataGridViewApi } from '@salmonui/data-grid';interface DataGridViewApi {
getViewport(): DataGridViewport;
subscribeViewport(listener: () => void): () => void;
getRowOffsets(): RowMetrics;
scrollTo(options: DataGridScrollToOptions): void;
getPageSizeForHeight(height: number): number;
}
| Name | Signature | Description |
|---|---|---|
getViewport | getViewport(): DataGridViewport; | Scroll sync extension point: the current body viewport. |
subscribeViewport | subscribeViewport(listener: () => void): () => void; | Calls |
getRowOffsets | getRowOffsets(): RowMetrics; | Row height extension point: the row offsets of the visible row model (the body's own prefix sums). |
scrollTo | scrollTo(options: DataGridScrollToOptions): void; | Scrolls the body to an offset. An omitted axis keeps its position; offsets are clamped to the scroll range. |
getPageSizeForHeight | getPageSizeForHeight(height: number): number; | Whole data rows that fit in |