A group of a row grouping (see RowGroupIf). Created by groupRows and AreaModelRowGroups – you don't create groups yourself.

Example

const groups = groupRows(sales, ["region"]);
aggregateRowGroups(groups, { umsatz: "sum" });
groups.map(g => `${g.label}: ${g.results.umsatz}`); // ["Nord: 270", "Süd: 180"]

Since

1.1.94

Type Parameters

  • T = any

    the row type

Hierarchy

  • RowGroup

Implements

Constructors

Properties

Accessors

Methods

Constructors

Properties

children: RowGroup<T>[] = []

The sub-groups, empty on the last level.

count: number = 0

The number of rows in the group (after the filter).

field: string

The name of the level (RowGroupFieldIf.name).

key: unknown

The key of the group, as the rows have it (null for the group of empty keys: null, undefined, "").

label: string

The key as text (format of the level, otherwise the default text).

level: number

The level, 0 = top.

parent: undefined | RowGroup<T>

The parent group, undefined on the top level.

path: readonly unknown[]

The keys from the top level down to this group.

results: Record<string, unknown> = {}

The aggregates of the group by key (after the filter), e.g. { umsatz: 270 }.

type: "RowGroup" = "RowGroup"

Marker for isRowGroup.

Accessors

Methods

  • The rows of the group and of all sub-groups, in the order of the grouped view: sub-group by sub-group, the rows of a group in source order – or sorted, after the table sorted them.

    Parameters

    • filtered: boolean = true

      only the rows the filter keeps

    Returns T[]

    a new array