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
Ability to turn the sorting off for a clicked column in GridView with multisort ignores defaultOrder #19731
Comments
I've added more tests to check the |
Thank you for taking the time to look into it! I must say that this is not actually a bug, but does allow for this weird scenario. Please let me try to describe the observed result. Following the example above, where sort is configured like this
a GridView using the dataprovider will sort by default on the Clicking this link, which as expected does not provide a sort query param, will result in displaying the page again with the defaultOrder (that is the GridView will sort again by default on the This only applies when sorting with the denoted field alone. |
Oh, I get it. Currently we cannot distinguish "no sort" from "desc sort switched off" resulting in default sorting applied in both cases automatically. Let me think about possible solution... |
Ok, this should fix the problem without BC breaks. |
If a field is set at the
defaultOrder
of aSort
specification with aSORT_DESC
ordering, andenableMultiSort
is set totrue
, the sort link is always generated the same and sorting inSORT_ASC
order is not possible.What steps will reproduce the problem?
Enable multisort and set defaultOrder on a property with SORT_DESC, i.e.
What is the expected result?
After #18826
changing the sorting of the designated field would be expected in the order:
DESC -> off -> ASC -> DESC ...
What do you get instead?
The sort link generated by $sort->link() is repeatedly setting sorting to OFF, due to the fact that the default ordering sets the order to DESC.
Additional info
The text was updated successfully, but these errors were encountered: