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

    Interface UseRowGroupingResult<T>

    What useRowGrouping returns.

    interface UseRowGroupingResult<T> {
        displayRows: GroupedDisplayRow<T>[];
        leafRows: T[];
        loadMore: (groupKey: string) => void;
        patchRows: (rows: T[], getRowId: (row: T) => string | number) => void;
        reset: () => void;
        toggleGroup: (groupKey: string) => void;
    }

    Type Parameters

    • T

      The row type.

    Index
    displayRows: GroupedDisplayRow<T>[]

    Every line to draw, in order.

    leafRows: T[]

    The ordinary rows among displayRows, in order: the page itself when not grouped, the rows loaded inside expanded groups when grouped.

    loadMore: (groupKey: string) => void

    Fetch the next block of an open group; also retries after an error.

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

    Patch rows already loaded inside groups, matched by id. No request is made; ids that are not loaded are ignored.

    reset: () => void

    Close every group and drop every loaded block, cancelling fetches in flight. Called for you whenever the query changes.

    toggleGroup: (groupKey: string) => void

    Open a closed group (fetching its first block if needed) or close it.