I am using store to show some data in a list.The store has a grouper in one screen and no grouper in another screen.Can I dynamically add and remove a grouper in strore. Thanks for all kinds of support.
This is the code:
Ext.define('MyApp.store.mystore', {
extend: 'Ext.data.Store',
requires: ['Ext.data.proxy.LocalStorage'],
config: {
identifier: {
type: 'uuid',
},
fields: [
{name: 'Fname', type: 'string'},
{name: 'Lname', type: 'string'}
],
remoteSort: true,
/* grouper: {
groupFn: function(record) {
if(localStorage.getItem('mainCategory')=='CONSOLIDATE REPORT')
return record.get('mainCategory');
else
return record.get('category_name');
}
},*/
// groupField: ['Fname'],
proxy: {
type: 'localstorage',
id: 'myyystore'
}
}
});
My list has no grouper property now.
My requirement is to display the list with grouper (Fname) in one screen and without grouper in another screen.
You can have two different Ext.List and control the grouped config.
Or you can just pass it when instantiating:
or
Hope it helps-