GoodNews.grid.Categories = function(config) {
config = config || {};
Ext.applyIf(config,{
id: 'goodnews-grid-categories'
,url: GoodNews.config.connectorUrl
,baseParams: { action: 'mgr/category/getList' }
,fields: [
'id'
,'name'
,'description'
,'goodnewsgroup_name'
,'membercount'
,'public'
,'menu'
]
,grouping: true
,groupBy: 'goodnewsgroup_name'
,singleText: _('goodnews.category')
,pluralText: _('goodnews.categories')
,primaryKey: 'name'
,sortBy: 'name'
,sortDir: 'ASC'
,paging: true
,remoteSort: true
,emptyText: _('goodnews.categories_none')
,save_action: 'mgr/category/updateFromGrid'
,autosave: true
,autoExpandColumn: 'description'
,collapseFirst: false
,columns: [{
header: _('goodnews.category_name')
,dataIndex: 'name'
,sortable: true
,width: 150
,editable: true
,editor: { xtype: 'textfield' }
},{
header: _('goodnews.category_description')
,dataIndex: 'description'
,sortable: false
,width: 250
,editable: true
,editor: { xtype: 'textfield' }
},{
header: _('goodnews.category_usergroup')
,dataIndex: 'goodnewsgroup_name'
,sortable: true
// this is temporary set to visible for testing!
//,hidden: true
,width: 100
,editable: false
},{
header: _('goodnews.category_public')
,dataIndex: 'public'
,align: 'center'
,sortable: false
,width: 80
,editable: true
,editor: {
xtype: 'combo-boolean'
,renderer: 'boolean'
}
},{
header: _('goodnews.category_membercount')
,dataIndex: 'membercount'
,align: 'center'
,sortable: false
,width: 100
,editable: false
}]
... // code goes on here
This question has been answered by markh. See the first response.
Been a while that I used grouping, but I'm pretty sure your processor will need to make sure it's always sorted on what you're grouping if you want it to work properly. Luckily you can just call xPDOQuery->sortby multiple times so if you add the sort on the groups in prepareQueryBeforeCount, it should work fine.