Skip to content

Grids: provide a more straightforward approach to sort by formatted values #14442

@ddaribo

Description

@ddaribo

Is your feature request related to a problem? Please describe.

Customers using custom column formatters usually want to sort based on them. Currently the grid sorts by the underlying column values. For filtering on the other hand, it suffices to assign an instance of the FormattedValuesFilteringStrategy to achieve this.
The existing approach to override this for sorting is to implement the ISortingStrategy interface, as in this sample.
This is a bit lengthy and involves extending the DefaultSortingStrategy just to modify the compareObjects function logic.
Moreover, further workarounds have to be implemented if users would like to reuse this custom strategy on multiple formatted columns.

As a side note, this approach is also merely mentioned in the docs here and since a demo is lacking is a question that is often brought up in support cases.

Describe the solution you'd like

Expose a FormattedValuesSortingStrategy, for example.

Describe alternatives you've considered

Additional context

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions