Query Groups should be related with Sort Criterions instead of with Layouts

Topics: Core, Customizing Orchard
Sep 30, 2015 at 11:34 PM
Edited Oct 1, 2015 at 5:24 AM
Currently Grouping features in Queries are related with Layouts instead of being related with Sort Criterions. In my opinion Group feature and Sort Criterions wouldn't have to be independent features because they are related.

The advantages of doing it in the way I propose are:
•It won't be posible for the user to set orders that doesn't fit with the group of the layout (order by price and group by family for example)
•It will improve performance, if those two features are dependent you don't need to order twice: one to apply sort criterions and other for grouping data.
•It will overcome limitations of current grouping done per page, that doesn't work with infinite scrolling.
•It will allow to have groupings for more than one field.
•It will group by the right fields when the final user choose each one of the Order Criterions available in the query. This only if you are using Mainbit Client Side Projector module that allows the end user to choose which Order Criterion to apply on the results shown (Here is a sample of this module http://orchard.mainbit.com/).

Here is a two part video with a demo of some of the improvements I have done on Mainbit Client Side Projector where I also talk about the limitations of current grouping feature in queries and how I would improve it:
I will be at Orchard Harvest 2015 (we at XK Project are helping to host the event in Alicante) so I will be happy to hear your feedback and discuss it live in Alicante if you are interested on it.

Cheers!

P.D: I have also added an issue to GitHub to discuss it https://github.com/OrchardCMS/Orchard/issues/5880