PDA

View Full Version : Grid with Grouping AND Filters



Thomas Triplet
21 Sep 2012, 7:51 AM
Hello,
I have a grid that works well with filters or the grouping feature, but not both together: whenever I enable grouping, it automatically disables the filters.


Ext.define('frontend.view.ResponseTimeTable', {
extend: 'frontend.view.Table'
,alias: 'widget.responsetimetable'
,requires: 'frontend.store.ResponseTimes'
,title: 'ResponseTimes'
,store: 'ResponseTimes'

/**
* Initialize the component.
*/
,initComponent : function() {
Ext.apply(this, Ext.apply(this.initialConfig, {
columns: [{
header: 'Comments',
flex: 1,
dataIndex: 'comments',
sortable: true,
editor: {
xtype: 'textfield'
}
,filter: { type: 'string' }
},
] // eo columns[]
,features: [ this.buildGrouper()]
}));

// init config, that may not be overriden
Ext.apply(this, Ext.apply(this.initialConfig, this.config));
this.callParent(arguments);
}
});

this.buildGrouper() is defined in the parent class (of type Ext.grid.Panel):



buildGrouper: function(recordType, hideGroupedHeader) {
return Ext.create('Ext.grid.feature.Grouping',{
hideGroupedHeader: hideGroupedHeader || false
,groupHeaderTpl: '{header}: {renderedValue} - {rows.length:plural("'+ (recordType || "record") +'")}'
});
} // eo buildGrouper()


Any suggestion greatly appreciated :)

PS: using ExtJS 4.1.1a

scottmartin
21 Sep 2012, 9:19 PM
See if this will help:
http://www.sencha.com/forum/showthread.php?219619

Scott.