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.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- itemsrequisArray<T>
- The flat list of data table rows to group.
- groupByrequisArray<string>
- Ordered list of property paths to group by. The first element is the outermost grouping level.
- depthnumber0
- Current recursion depth. Start at 0 (default) for the outermost call.
- prefixstring'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