Interface RowGroupFieldIf<T>

One level of a row grouping in full form: where the key of a row comes from and how the groups of the level are named and ordered. The short form is just the ValueAccessor ("region" or a function).

Example

// year › month from a date, newest year first, month names as labels
const groupBy: RowGroupField<Order>[] = [
{ name: "year", label: "Year", value: o => new Date(o.date).getFullYear(), order: "desc" },
{ name: "month", label: "Month", value: o => new Date(o.date).getMonth(), format: m => MONTHS[m as number] }
];

Since

1.1.94

Type Parameters

  • T = any

    the row type

Hierarchy

  • RowGroupFieldIf

Properties

format?: ((key) => string)

Type declaration

    • (key): string
    • The text of a key in the group label. Default: the key as text, dates as date (en-US), empty keys emptyLabel. Text only – never HTML.

      Parameters

      • key: unknown

      Returns string

label?: string

The name of the level, e.g. in the header of the group column. Default: the header label of the column with this property, otherwise the name.

name?: string

The id of the level – part of the group ids that remember expanded groups (RowGroupIf.id). Default: the property path; for a function "level<N>" (give functions a name if you switch between them).

The order of the groups of this level. Default "asc".

value: ValueAccessor<T>

The key of a row: a property path ("region", "address.city") or a function (computed keys).