When you display a rowset in batches and want to offer the user to sort the results, you can do this in several ways:
1.) Using 4D's "order by" before you create the rowset. 2.) Using $rs->sort after you created the rowset but then you have to use newFromCachedSelection to create your rowset. With 1.) you tie yourself to the database structure, which in general should be avoided. With 2.) performance drops significantly if the rowset is much larger than the batch size, as you populate the rowset with data, that probably never is actually displayed. IMHO you can't use a subset (which would help with 2.) if you want to sort the rowset because this would only sort the subset, which doesn't make sense. As this is probably a standard feature in most shopping cart applications, I'd like to ask, what approach others have used. I think there is a "best practice" to deal with it. Currently I tend to use 4D's order by before creating the rowset but maybe there are good reasons to do it a different way. Peter _______________________________________________ Active4D-dev mailing list [email protected] http://list.aparajitaworld.com/listinfo/active4d-dev Archives: http://active4d-nabble.aparajitaworld.com/
