• What is KendoReact
  • Getting Started
  • Server Components
  • Components
    • Animation
    • Barcodes
    • Buttons
    • Chartsupdated
    • Common Utilities
    • Conversational UIupdated
    • Data Gridupdated
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Formupdated
    • Ganttupdated
    • Gauges
    • Indicators
    • Inputsupdated
    • Labels
    • Layoutupdated
    • ListBox
    • ListView
    • Map
    • Notification
    • OrgChartnew
    • PDF Processing
    • PDFViewer
    • PivotGrid
    • Popup
    • Progress Bars
    • Ripple
    • Scheduler
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • TaskBoard
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Upload
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

composeSortDescriptors

Converts the SortDescriptors into a Comparer function that can be used through Array.sort. If multiple descriptors are provided, sorting is applied in a right-to-left order.

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

const data = [{ name: "Pork" }, { name: "Pepper" }, { name: "Beef" } ];
const comparer = composeSortDescriptors([{ field: "name", dir: "asc" }]);
const result = data.sort(comparer);
// output: [{ name: "Beef" }, { name: "Pepper" }, { name: "Pork" }];

Parameters

descriptors SortDescriptor[]

The descriptors which will be converted.

Returns

Comparer - The produced function.

In this article

Not finding the help you need?