Sort by more criteria

Features wanted...
Post Reply
serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Sort by more criteria

Post by serendipity »

Normally when I sort a list by say "extension", the list is sorted by extension first and then by name. This I guess is a default set up.
In excel for example, there is this nice option to sort columns by Column A then by Column B and so forth.
Similarly in XY I would like to sort files by extension and then by size and then by created etc which would make my life easier at times.
I am sure some of you have come across huge lists where sorting by one criterion is too basic to figure out something. Just wondering if its just me.

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Post by lukescammell »

Not a deal breaker for me, but it is certainly something that I think at least once every month without fail - sometimes several times in a day. Don't ask me for specifics on when this would have been useful as I really don't recall, but I certainly keep thinking about this one...
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

admin
Site Admin
Posts: 66300
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

Yes, it's useful. Actually I DO sort by secondary criteria, but that's always hard-coded to "Name". To make it soft on-demand is of course better.

I won't have the time to do it now, but as for the interaction: how about holding Shift while clicking a column header to make this column the 2nd criterion?

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

admin wrote:Yes, it's useful. Actually I DO sort by secondary criteria, but that's always hard-coded to "Name". To make it soft on-demand is of course better.

I won't have the time to do it now, but as for the interaction: how about holding Shift while clicking a column header to make this column the 2nd criterion?
Nice idea. I was thinking of something similar.

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

admin wrote:Yes, it's useful. Actually I DO sort by secondary criteria, but that's always hard-coded to "Name". To make it soft on-demand is of course better.

I won't have the time to do it now, but as for the interaction: how about holding Shift while clicking a column header to make this column the 2nd criterion?
:roll: Duh! Another one of those "Why didn't we think of this before?" items...yes, of course this would be useful! :)

And the proposed Shift would be fine with me...however: What about the menu method for us T-P/mouse'rs? I'd say we add a sub-menu to the View>Curr Tab>Sort By which would simply be another "Sort By" that would have the primary sort field grayed out to prevent its selection...this could possibly expanded to one futher level using same method IF three levels of sort would be possible...but the most important is a user-defined minor sort!
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

admin wrote:I won't have the time to do it now, but as for the interaction: how about holding Shift while clicking a column header to make this column the 2nd criterion?
Yeah, if it can be done that would be a nice thing, yes :) Holding Shift while clicking the column header is just fine. And also when clicking on the menu, to keep this consistent (as well as allowing to sort by criteria not shown)
Proud XYplorer Fanatic

Pagat
Posts: 307
Joined: 09 Oct 2007 21:23
Location: Austria

Post by Pagat »

If you (Don) use a stable sorting algorithm then why even sort by secondary criteria on each click?
With a stable algorithm and sorting only by one criteria each time, there would be no need for any interface:
If you want to have your list sorted "by Date then by extension", simply click first on "extension" and afterwards on "Date" -> Files that are from the same date would remain in their previous order (in this case "by extension").

This way you can also easily sort by three (or even four, five, ...) criteria; simply by clicking onto the according headers one after another.
OS: Windows 11, 64-bit, Version 25H2, Build 26200.8655 (10.0), AMD64
Monitor: 1/2 (Primary) Primary Screen DPI: 96 (100%)

admin
Site Admin
Posts: 66300
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

Pagat wrote:If you (Don) use a stable sorting algorithm then why even sort by secondary criteria on each click?
With a stable algorithm and sorting only by one criteria each time, there would be no need for any interface:
If you want to have your list sorted "by Date then by extension", simply click first on "extension" and afterwards on "Date" -> Files that are from the same date would remain in their previous order (in this case "by extension").

This way you can also easily sort by three (or even four, five, ...) criteria; simply by clicking onto the according headers one after another.
I use Quicksort (not stable). But no problem, I have secondary sorting built in already, and it's extremely fast.

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

Pagat wrote:With a stable algorithm and sorting only by one criteria each time, there would be no need for any interface:

This way you can also easily sort by three (or even four, five, ...) criteria; simply by clicking onto the according headers one after another.
And how would this work for someone who wants to use menu options strictly?
Also, if I've decided to totally redo my sort seq, under your solution, i'd likely have to refresh my list first to undo any prior seq...plus there needs to be some method to indicate which field is the main/major field...so as proposed, click would be major, shift+click is minor...which solves the problem.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

Pagat
Posts: 307
Joined: 09 Oct 2007 21:23
Location: Austria

Post by Pagat »

j_c_hallgren wrote:plus there needs to be some method to indicate which field is the main/major field...so as proposed, click would be major, shift+click is minor...which solves the problem.
with a stable algorithm it would be "first click -> minor", "second click -> major". you are right, there wouldn't be any visual indicator which of the fields is the minor (out of the box; of course it could be added...)

anyway, since Don is using QuickSort and he has already figured it out, it's obsolete to think about the "stable way" anymore.

But: Is "Name" now used as third criterion or are only two criteria used? Because if two files are the same for both criteria their order would be "random" if no third criterion (name) comes into place, right?
OS: Windows 11, 64-bit, Version 25H2, Build 26200.8655 (10.0), AMD64
Monitor: 1/2 (Primary) Primary Screen DPI: 96 (100%)

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

Pagat wrote:But: Is "Name" now used as third criterion or are only two criteria used? Because if two files are the same for both criteria their order would be "random" if no third criterion (name) comes into place, right?
I am not sure, but I assume/expect so. Just like how currently the secondary sort is hard-coded to "Name".

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

I would think we'd want some field (like name) to be the hidden last sort field so that results wouldn't change if one redid sort..that could cause user confusion...
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

Code: Select all

+++ List: Added secondary sorting.
:D Thanks for that. Works as expected.

Post Reply