View as Markdown

API reference: @salmonui/data-grid

DataGridInfiniteScrollFacadetype

import type { DataGridInfiniteScrollFacade } from '@salmonui/data-grid';
type DataGridInfiniteScrollFacade<Row = unknown> = Omit<InfiniteScrollFacade<Row>, 'getStats' | 'isRowLoaded'> & {
    getStats(): InfiniteScrollStats | undefined;
    isRowLoaded(index: number): boolean | undefined;
};

api.engine.infiniteScroll: the infiniteScroll module façade. loadNext() reads the block after the last loaded row, retry() re-reads failed blocks, reload() re-reads from the start (infiniteScroll.loadNext / retry / reload through engine.dispatch); getStatus() is the load state. Until the lazy infinite chunk is installed (right after mount on the client), commands are rejected with moduleLoading, getStats() and isRowLoaded() return undefined and getStatus() is the at-rest state.

DataGridInfiniteScrollFacade members (7, 7 inherited)
NameSignatureDescription
getStatusinheritedgetStatus: () => InfiniteScrollState;

Load state, exact total (null while unknown) and loaded row count.

ensureRangeinheritedensureRange: (start: number, end: number) => void;

Viewport sink: the renderer reports the rendered rows [start, end) when its row window changes (never per scroll frame). Schedules loads; does not change the slice until a load settles.

loadNextinheritedloadNext: (payload?: PayloadOf<InfiniteScrollLoadNextCommand> | undefined) => CommandResult;
reloadinheritedreload: (payload?: PayloadOf<InfiniteScrollReloadCommand> | undefined) => CommandResult;
retryinheritedretry: (payload?: PayloadOf<InfiniteScrollRetryCommand> | undefined) => CommandResult;
getStatsinheritedgetStats: () => InfiniteScrollStats | undefined;
isRowLoadedinheritedisRowLoaded: (index: number) => boolean | undefined;