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 (in your Custom Sort Predefined Config) 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 - e.g. what we provide for the 'Contact' and 'Ship Via' columns in this demo
- A standard comparer function - that you reference in Config, but provide the actual implementation in UserFunctions . The 'Employee' column in this demo has a custom sort using the 'EmployeeLastName' function (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).