View Full Version : Paging, grouping and sorting

18 Aug 2010, 12:33 AM
Hi there! Me again, with a brand new question.

SitRep first: I got a paging grid, with sort enabled, meaning I have to sort the list before returning the PagingLoadResult. But people can group the grid using whichever field they want.

But when you sort, the group explode: users think the group is complete, but it's just a group of what is displayed on this page. Therefore, I need the service to sort on two levels: first the grouping field, then the sorting field. No problem except that I don't know the grouping field.

I don't know if my problem is clear, but whatever, the question will be (at least I hope): is there a way to get the grouping field inside the PagingLoadConfig (using the get()/set() should be no problem) before each call to loader.load() ?

Thanks in advance!

18 Aug 2010, 1:22 AM
You can add a BeforeLoad listener to the loader and safe the groupingfield to your loadconfig.

18 Aug 2010, 2:43 AM
I was surprised I didn't found a Events.BeforeLoad, it appears I didn't look deep enough. Thanks sven, it works just fine!