How to group a list but change the group order...
Hi,
I am wondering if it is possible to change the order of a grouped list. For example:
Code:
Ext.define('a.store.S', {
extend: 'Ext.data.Store',
config:
{
model: 'a.model.S',
grouper: {
groupFn: function (record) {
return record.get('group').substr(2);
}
},
data: [
{title: 'a title', group: '2-A group', url: 'some url'},
{title: 'b title', group: '2-A group', url: 'some url'},
{title: 'c title', group: '1-B group', url: 'some url'},
{title: 'd title', group: '1-B group', url: 'some url'},
{title: 'e title', group: '0-C group', url: 'some url'},
]
This list will be grouped by the group field but the order of the groups would be as follows:
A group
B group
C group
If I do not use the substr method then the groups would be in the order that I desire but with the undesirable prefix:
0-C group
1-B group
2-A group
Is it possible to make the groups in this list ordered and displayed as follows?
C group
B group
A group