Custom Sort Demo

The Custom Sort function allows you to specify a bespoke custom sort order when a column is sorted (in place of the default alphabetical or numbered sort).

This is ideal for columns where the default sort order doesnt make sense (e.g. a 'Ratings' or 'Tenor' column) where you will want to provide a standard non-alphabetical sort.

It is also suitable for columns where some users might have their own preferred non standard sort (e.g. a 'Sector' column).

You can define Custom in 2 ways: (in your ) a Custom Sort in 2 ways, both of which will be used to sort the column when the header is clicked:

  • A 'hard-coded' list of sorted values in Custom Sort Predefined Config
    This is what we provide for the 'Contact' and 'Ship Via' columns in this demo.

  • A JavaScript comparer function via the columnSortComparers property in General Options
    The 'Employee' column in this demo uses a comparer function which will sort by Last Name (see the code below).

Custom Sorts will also run when the Grid is in pivot mode (see Pivot Layout) or if you sort on the column when its grouped (see Group Layout).

Generating dummy data, please wait ...