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

Order

methods

Returns a copy of the list sorted according to the direction

dir String

The sort order (direction). The supported values are "asc" (ascending order) and "desc" (descending order).

Parameters:selectorObject

The current sort configuration.

selector.fieldString | Function

The field by which the data items are sorted.

Returns:kendo.data.Query

Returns a new instance of kendo.data.Query containing the sorted collection

<script>
    const query = new kendo.data.Query([
        { name: "Jane Doe", age: 30 },
        { name: "John Doe", age: 33 },
        { name: "Bob Smith", age: 25 },
        { name: "Alice Johnson", age: 28 }
    ]);
    
    const sortedQuery = query.order("age", "desc");
    const result = sortedQuery.toArray();
    // the result can be seen in the browser console.
    console.log(result); // Will be sorted by age in ascending order
</script>
Not finding the help you need?
Contact Support