Posted 14 September 2017, 11:15 am EST
Is there a standard way to implement custom/manual sorting based on a sort function rather than using SortDescriptions? It seems that SortDescriptions are quite limited to what would be considered the ‘natural’ sort order of single fields.
There are a few approaches I see but I’d rather not use a non-optimal solution:
- CollectionView has a prototype method _compareItems (meant to be private) which could be forcibly overridden.
- Alter the source data structures to be more complex so that they contain both the value and the ‘sortValue’ and then interrupt the FlexGrid request to sort to calculate and use this metadata when sorting
- There is an IComparer interface, but it does not seem to be used. Would require forking to make sort uniformly use IComparer for SortDescriptions and then create a new implementer of IComparer for user-defined sort functions. This seems like the ‘proper’ solution and may be the path you all initially set to follow - did you plan on implementing it like this soon?