mmikkel / CpSortableCustomColumns-Craft

Adds custom fields to sortable attributes in element indexes
41 stars 5 forks source link

Retain default sorting option regardless of selection (as Craft natively does) #6

Open timkelty opened 8 years ago

timkelty commented 8 years ago

Craft natively always lets you sort by a handful of criteria:

screen shot 2016-06-15 at 12 09 41 am

Once you enable this plugin, these go away. So if you want to sort by "date updated", you have to add a column for it.

mmikkel commented 8 years ago

Hi @timkelty – thanks for contributing!

I can see the use case for wanting to have a certain attribute (e.g. "Date Updated") in the dropdown without having to display it in the table, although the current behaviour is actually by design.

Personally, I find sorting on attributes that isn't displayed in the actual element index a bit confusing; IMO its much clearer when the dropdown and table mirror each other. Also, it isn't uncommon that a few of those "default attributes" is either not useful or even totally irrelevant to the current index (I'm looking at you, "Expiry Date"), so being able to strip out those attributes where you don't need them is a plus, in my book.

I think this is mostly a personal preference thing, though. I'm totally open to having my mind changed on the matter and I'd love to hear arguments in favor of retaining the default attributes for all indexes (it has to be an either/or thing, as I'm definitely not going to add some sort of UI on top of the CEI).

timkelty commented 8 years ago

No, I think you're right on all accounts. After I made the issue I realized it was probably by design :)

Go ahead and close if you like!

mmikkel commented 8 years ago

Awesome – thanks for getting back to me, @timkelty. I'll leave the issue open for a little while, maybe someone has opinions :)