sortItems
DataTable
stable
Sort an array of internal data-table items by one or more sort keys and directions, with optional custom compare functions per key.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- itemsrequisT[]
- The array of internal items to sort. Each item must satisfy IInternalItem (has a raw property).
- sortByItemsrequisArray<IDataTableSortItem>
- Ordered list of sort descriptors. Each entry specifies a key and an order ("asc" | "desc" | false).
- options{ transform?: (item: T) => Record<string, any> sortFunctions?: Record<string, TDataTableCompareFunction> sortRawFunctions?: Record<string, TDataTableCompareFunction> }
- Optional overrides: transform maps an item before comparison; sortFunctions and sortRawFunctions provide per-key compare functions.
API
Valeur de retour
La valeur retournée par cet util.
- A new sorted array of items. The original array is not mutated.
Usage
Exemples
Extraits de code prêts à coller.
Sort by a single key ascending