View as Markdown

API reference: @salmonui/data-grid/engine

GroupingMethodstype

import type { GroupingMethods } from '@salmonui/data-grid/engine';

Also exported from @salmonui/data-grid/engine/grouping.

type GroupingMethods<Row> = {
    getGroup(ctx: ModuleContext<Row>, rowId: RowId): GroupRowSnapshot | undefined;
    getGroupRows(ctx: ModuleContext<Row>, rowId: RowId): readonly Row[];
    isExpanded(ctx: ModuleContext<Row>, group: GroupTarget): boolean;
    getLazyStatus(ctx: ModuleContext<Row>): {
        readonly status: LazyStatus;
        readonly error: unknown;
    } | null;
};
GroupingMethods members (4)
NameSignatureDescription
getGroupgetGroup(ctx: ModuleContext<Row>, rowId: RowId): GroupRowSnapshot | undefined;

Caption or footer snapshot by row id (__g: / __gf: ids). Identity is stable while nothing about the group changes.

getGroupRowsgetGroupRows(ctx: ModuleContext<Row>, rowId: RowId): readonly Row[];

Data rows of a group (template items), in view order.

isExpandedisExpanded(ctx: ModuleContext<Row>, group: GroupTarget): boolean;

Whether a group (row id, path key, or path) is expanded.

getLazyStatusgetLazyStatus(ctx: ModuleContext<Row>): { readonly status: LazyStatus; readonly error: unknown; } | null;

Lazy mode root level status.