groupItems

DataTable
stable

Recursively groups an array of data table rows by one or more property keys. Each level produces an array of IDataTableGroup objects that carry depth, id, key, value, and the nested items. Used internally by OrigamDataTable grouping.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

items
requis
Array<T>
The flat list of data table rows to group.
groupBy
requis
Array<string>
Ordered list of property paths to group by. The first element is the outermost grouping level.
depth
number
0
Current recursion depth. Start at 0 (default) for the outermost call.
prefix
string
'root'
Prefix used to build stable unique group ids. Defaults to "root".

API

Valeur de retour

La valeur retournée par cet util.

A nested array of group descriptors. Returns an empty array when groupBy is empty.

Usage

Exemples

Extraits de code prêts à coller.

Single-level grouping

typescript