@helix-x/datagrid-ui - v0.2.0
    Preparing search index...

    Interface UseServerDataSourceResult<T>

    What useServerDataSource returns.

    interface UseServerDataSourceResult<T> {
        error: unknown;
        isLoading: boolean;
        isStale: boolean;
        patchRows: (rows: T[], getRowId: (row: T) => string | number) => void;
        refresh: (options?: { purge?: boolean }) => void;
        rows: T[];
        totalRows: number;
    }

    Type Parameters

    • T

      The row type.

    Index
    error: unknown

    The last error, or null.

    isLoading: boolean

    True while a fetch is in flight.

    isStale: boolean

    True when rows still belong to an earlier query (another sort, filter, page size or grouping) because the current one has not answered yet. The grid uses it so that rows fetched ungrouped are never drawn as group rows, or the reverse.

    patchRows: (rows: T[], getRowId: (row: T) => string | number) => void

    Patch loaded rows in place, matched by id. Ids that are not loaded are ignored. No network request is made.

    refresh: (options?: { purge?: boolean }) => void

    Re-fetch the current page.

    Type Declaration

      • (options?: { purge?: boolean }): void
      • Parameters

        • Optionaloptions: { purge?: boolean }

          purge: true drops every cached block first.

        Returns void

    rows: T[]

    Rows for the current page. Empty while the first fetch is in flight.

    totalRows: number

    Total across all pages, from the response's lastRow.