Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ddaribo opened this issue Jun 27, 2024 · 0 comments · Fixed by #14538
Closed

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

ddaribo opened this issue Jun 27, 2024 · 0 comments · Fixed by #14538
Assignees
Labels
grid: sorting grid 🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@ddaribo
Copy link
Contributor

ddaribo commented Jun 27, 2024

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

@georgianastasov georgianastasov self-assigned this Jul 16, 2024
@georgianastasov georgianastasov added 🛠️ status: in-development Issues and PRs with active development on them and removed 🆕 status: new labels Jul 16, 2024
@georgianastasov georgianastasov added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Jul 17, 2024
@georgianastasov georgianastasov added 🛠️ status: in-development Issues and PRs with active development on them ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. 🛠️ status: in-development Issues and PRs with active development on them labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grid: sorting grid 🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
3 participants