PDA

View Full Version : GroupViewing Sorting



ronbravo
6 Mar 2010, 7:09 PM
Hi all. I am using the GroupViewing for a grid and currently the data is being sorted by the date. The only problem I have at the moment is that groups are in Ascending order. Is there a way to have the groups placed in Ascending order?

Now I don't mean the actual rows within the groups, I mean the groups themselves. Any help or advice is appreciated and thanks in advance.

fay
7 Mar 2010, 4:13 AM
There is a groupDir config option that you can specify when creating your GroupingStore. There's probably a good reason why it's not documented - it could be changed in the future - so use it with caution.

Example:


var store = new Ext.data.GroupingStore({
reader: reader,
data: xg.dummyData,
sortInfo:{field: 'company', direction: "ASC"},
groupField:'industry',
groupDir: 'DESC'
});

steffenk
7 Mar 2010, 4:18 AM
why should it change? If you have remote store, this is sent too with a group store.

fay
7 Mar 2010, 4:30 AM
why should it change?

Absolutely no reason at all, it's just a rule of thumb I apply to any undocumented "feature" of any framework I work with: if it's a feature I need but not in the documentation, I'll note it in my code, which just helps when migrating to newer versions.

steffenk
7 Mar 2010, 5:17 AM
the reason also could be simple - it's just missing in docs by accident. i will report it, let's see.

ronbravo
8 Mar 2010, 11:25 PM
Excellent. Thanks for the reply.