New to Kendo UI for AngularStart a free 30-day trial

orderBy

Function

Definition

Package:@progress/kendo-data-query

Syntax:

ts
import { orderBy } from '@progress/kendo-data-query';

const data = [
    { name: "Pork", category: "Food", subcategory: "Meat" },
    { name: "Pepper", category: "Food", subcategory: "Vegetables" },
    { name: "Beef", category: "Food", subcategory: "Meat" }
];

const sortDesc: SortDescriptor[] = [{ field: "name", dir: "asc" }];

const result = orderBy(data, sortDesc);

Orders the specified array according to the provided sort descriptors.

Parameters:dataT[]

The data to be sorted.

descriptorsSortDescriptor[]

The descriptors by which the data will be sorted.

Returns:

T[]

  • The sorted data.
In this article
Definition
Not finding the help you need?
Contact Support