• Getting Started
  • Components
    • Barcodes
    • Buttons
    • Chartsupdated
    • Conversational UIupdated
    • Data Query
    • Date Inputsupdated
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Filter
    • Gantt
    • Gauges
    • Gridupdated
    • Icons
    • Indicators
    • Inputsupdated
    • Labels
    • Layout
    • ListBox
    • ListView
    • Map
    • Menus
    • Navigation
    • Notification
    • Pager
    • PDF Export
    • PDFViewer
    • PivotGridupdated
    • Popup
    • ProgressBars
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • ToolBar
    • Tooltips
    • TreeList
    • TreeView
    • Typography
    • Uploads
    • Utilities
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Sample Applications
  • FAQ
  • Troubleshooting
  • Updates
  • Changelogs
New to Kendo UI for Angular? Start a free 30-day trial

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?