I currently have a grid with a grouping feature that gets data from a fixed store:
Ext.define('YUK.store.FakePendingDocs', {
extend: 'Ext.data.Store',
id: 'FakePendingDocs',
autoSync: false,
proxy: {
type: 'memory'
},
fields: [ { name: 'docId', mapping: 'did' }
, { name: 'name', mapping: 'name'}//, mapping : 'name'}
, { name: 'client',mapping: 'cid' }
, { name: 'description', mapping: 'description' }
, { name: 'uploadeddate', mapping: 'dl', type: 'date', dateFormat: 'MS' }
, { name: 'folder', mapping: 'fo' }
, { name: 'group', mapping: 'gr' }
],
groupers: [{
property: 'group',
direction: 'ASC'
}],.
data: [ ... ]
}
);
Then i do in my grid:
Ext.define('YUK.view.center.pendingdocuments.Panel', {
extend: 'Ext.grid.Panel',
alias: 'widget.documents',
id: 'documents',
title: 'My Documents',
store: 'FakePendingDocs',
hideHeaders: true,
forceFit: true,
groupField: 'group',
....
But i have the problem that my selection is scrambled in my grid (i select an item and i get another one). I found this http://www.sencha.com/forum/showthread.php?208453 thread to solve this. But since i'm new to sencha i don't know how to override this. I have done things like :
Ext.define('YUK.store.FakePendingDocs', {
extend: 'Ext.data.Store',
id: 'FakePendingDocs',
autoSync: false,
proxy: {
type: 'memory'
},
fields: [ { name: 'docId', mapping: 'did' }
, { name: 'name', mapping: 'name'}//, mapping : 'name'}
, { name: 'client',mapping: 'cid' }
, { name: 'description', mapping: 'description' }
, { name: 'uploadeddate', mapping: 'dl', type: 'date', dateFormat: 'MS' }
, { name: 'folder', mapping: 'fo' }
, { name: 'group', mapping: 'gr' }
],
groupers: [{
property: 'group',
direction: 'ASC'
}],.
data: [ ... ],
sort:function(){
var me = this, groups, g;
me.callOverridden(arguments);
groups = me.getGroups();
me.data.clear();
Ext.Array.each(groups, function (group) {
Ext.Array.each(group.children, function (child) {
me.data.add(child.internalId, child);
});
});
me.fireGroupChange();
}
}
);
But this doesn't work , neither does putting it in the grid.
Can someone help me with this ?
P.S: my groupingfeature for the grid looks like this:
var groupingFeature = Ext.create('Ext.grid.feature.Grouping', {
groupHeaderTpl: '{name}'
});