Grids: provide a more straightforward approach to sort by formatted values #14442
Labels
grid: sorting
grid
🧰 feature-request
✅ status: resolved
Applies to issues that have pending PRs resolving them, or PRs that have already merged.
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 thecompareObjects
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
The text was updated successfully, but these errors were encountered: