@serenity-is/sleekgrid / Group
Class: Group<TEntity>
Defined in: src/core/group.ts:8
Represents a group of rows produced by a DataView grouping.
Extends
Type Parameters
TEntity
TEntity = any
Row item type being grouped.
Constructors
Constructor
new Group<
TEntity>():Group<TEntity>
Returns
Group<TEntity>
Inherited from
Properties
__group
readonly__group:true=true
Defined in: src/core/group.ts:10
Marker flag identifying this row as a group header.
__nonDataRow
__nonDataRow:
boolean=true
Defined in: src/core/base.ts:11
Marker flag used at runtime to identify non-data rows.
Checked by the grid and DataView to skip data-specific handling.
Inherited from
collapsed
collapsed:
boolean=false
Defined in: src/core/group.ts:30
Whether the group is currently collapsed (children hidden).
count
count:
number=0
Defined in: src/core/group.ts:20
Number of leaf rows in the group (excluding group headers/totals).
formatValue()
formatValue: (
ctx) =>FormatterResult
Defined in: src/core/group.ts:53
Formatter that renders the group value as text.
Parameters
ctx
FormatterContext<Group<TEntity>>
Returns
groupingKey
groupingKey:
string
Defined in: src/core/group.ts:50
Unique key used to identify the group; pass to DataView.collapseGroup() / expandGroup().
groups
groups:
Group<TEntity>[]
Defined in: src/core/group.ts:45
Child groups when multiple grouping levels are active.
level
level:
number=0
Defined in: src/core/group.ts:15
Grouping level, starting with 0 for top-level groups.
rows
rows:
TEntity[] =[]
Defined in: src/core/group.ts:40
Leaf rows that are part of the group.
totals
totals:
GroupTotals<TEntity>
Defined in: src/core/group.ts:35
Associated totals row for the group, if aggregation is enabled.
value
value:
any
Defined in: src/core/group.ts:25
Grouping value that all rows in this group share (e.g. the field value).
Methods
equals()
equals(
group):boolean
Defined in: src/core/group.ts:60
Compares two groups by value, count and collapsed state.
Parameters
group
Group
Group instance to compare to.
Returns
boolean
true if the groups are equal by the above fields.