-
Notifications
You must be signed in to change notification settings - Fork 512
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
Sort on click: descending first, then ascending #468
Comments
No there is no way at the moment to change the order of the different states, I am sorry |
I think it should be doable if you had a new attribute st-sort-descending="true" or something like that, which you could apply to any sortable column. Would you be open for a pull request to include that? I can give it a try. :) In that case, I would also remove st-sort-default="reverse", separating the notion of ordering direction from that of the default sorting column. |
@alberto better change the order in config. |
Thanks @stanleyxu2005 I didn't know you can change the order in the config. Anyway, I want to be able to make some columns descending first (e.g date) and others ascending first (category) so a global change doesn't fix my problem. |
I'm also very interested in this feature. Any suggestions on how to implement it? I'm an absolute beginner in Angular... |
Please add support for this! It's the only reason I simply can't use it for my project, while I think it's the best and cleanest Angular table module. After trying most of them, Smart Table is by far the best/easiest solution, but I had to switch (back) to ng-table because of this :( I suggest naming the attribute st-sort-initial, which accepts 'asc' and 'desc', and defaults to 'asc'. |
Would love this feature too!!! |
+1 I have a large table with 1k metrics records. Usually I want to see the largest throughput, but now I have to click column twice.. |
FYI: |
timonwong, I looked at the code there and it seems to only reverse the initial sort. It doesn't seem like it would enable column-by-column default sort order reversal upon clicking each column. Please let me know if I'm wrong. |
Here's an implementation. Until it's merged you can use that branch. |
+1 please |
@andy-dumbell do you realize, it has been merged and it is already available ? |
Thanks @lorenzofox3 I hadn't realised. Will try now. Cheers Andy |
👍 |
By default, Smart-Table sort states are ascending, descending, default, in that order.
Is there a way to make the order: descending, ascending, default?
Please notice I am talking about the behaviour of any column when its header is clicked, not the ordering of the default column (st-sort-default).
The text was updated successfully, but these errors were encountered: