Sort Order on Template Grid when using association

Why is it not possible to have a sort order on a template grid when retrieving data by association? It is possible if you retrieve from the database.
2 answers

To do sorting here is relatively complex as the data is (potentially) gathered from both the cache and the database in the case of reverse associations. Normally sorting is done by the database itself. Since this feature was not critical, we skipped it at the time. Please do file a feature request, I agree it would be very nice to have.


Hi Simon. I'm not sure what your problem is - perhaps I'm not understanding. The image below shows sort order defined for template grids retrieved both from database and through an association

template gridsalt text

Edit: So, I did not grasp what you were talking about, but now I understand. Data grids or template grids created in earlier versions of Mendix are as shown in the screenshot above, as source database over the association, and these can be sorted. v4 seems to have introduced another option, so your data source can be database, database over association, or just association.

I've had a quick look through the documentation and cannot find any clear description of what the difference is between using an association as the data source, and using database over an association (which was the method used in earlier versions).

So why are there now two (or even 3 - I can also use x-path) methods of achieving the same result? Is there a performance benefit in using one method over the other?