View as Markdown

API reference: @salmonui/data-grid

DataGridInfiniteScrollinterface

import type { DataGridInfiniteScroll } from '@salmonui/data-grid';
interface DataGridInfiniteScroll<Row = unknown> {
    cache?: boolean;
    initialBlocks?: number;
    maxBlocks?: number;
    blockSize?: number;
    threshold?: number;
    debounce?: number;
    initialResult?: {
        readonly rows: readonly Row[];
        readonly totalRowCount?: number;
        readonly hasNextPage?: boolean;
    };
}

infiniteScroll settings.

DataGridInfiniteScroll members (7)
NameSignatureDescription
cacheoptionalcache?: boolean;

Keep at most maxBlocks blocks of rows in memory. Default false: every loaded block is kept.

initialBlocksoptionalinitialBlocks?: number;

Blocks of the first request. Default 3.

maxBlocksoptionalmaxBlocks?: number;

Blocks kept with cache; never fewer than the viewport needs. Default 3.

blockSizeoptionalblockSize?: number;

Rows per block and per request unit. Default 100.

thresholdoptionalthreshold?: number;

Rows before the loaded end, and around the viewport, at which a block is requested. Default half a block.

debounceoptionaldebounce?: number;

Quiet time (ms) before requesting a jump target (scrollbar drag) and between sequential requests. Default 50.

initialResultoptionalinitialResult?: { readonly rows: readonly Row[]; readonly totalRowCount?: number; readonly hasNextPage?: boolean; };

The first blocks, fetched by the app (for example in a server component): rendered on the server and on the first client render, and not requested again. Rows start at row 0.