PDA

View Full Version : Group Header template



rainmaker
21 Nov 2011, 12:18 PM
Is there a way to include a count in the groupHeaderTpl?

this.features = [{
id: 'group',
ftype: 'groupingsummary',
groupHeaderTpl: 'Issuing Fund: {name}',
hideGroupedHeader: true,
enableGroupingMenu: false
}];

I like the groupHeaderTpl to display for example: ' Issuing Fund: 100.106 (6)', where 6 is the total count in the group. Is this possible?

rainmaker
21 Nov 2011, 12:42 PM
I have figured it out. Adding ({rows.length}) into the template is the trick. Thanks.

tobiu
21 Nov 2011, 12:44 PM
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.feature.Grouping

Example Usage


var groupingFeature = Ext.create('Ext.grid.feature.Grouping', {
groupHeaderTpl: 'Group: {name} ({rows.length})', //print the number of items in the group
startCollapsed: true // start all groups collapsed
});

tobiu
21 Nov 2011, 12:45 PM
3 answers almost simultaneously^^