All Components

orderBy

Orders the specified array according to the provided sort descriptors.

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 result = orderBy(data, [{ field: "name", dir: "asc" }]);

Parameters

data T[]

The data to be sorted.

descriptors SortDescriptor[]

The descriptors by which data will be sorted

Returns

T[] The sorted data.

In this article