PDA

View Full Version : how to show grouped value in Extjs 4 grid groupHeader?



extremed
22 Sep 2011, 1:13 PM
Hi

I have a grid like this


var groupingFeature = Ext.create('Ext.grid.feature.Grouping', {
groupHeaderTpl: 'Invoice: {invoice_number} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'
});

{
xtype : 'grid',
store : Ext.getStore('invoice_items'),
columns : [
{ text: 'Invoice Number', flex: 1, dataIndex: 'invoice_number', hidden:true },
{ text: 'Item Code', flex: 1, dataIndex: 'item_code'},
{ text: 'Description', flex: 1.5, dataIndex: 'description' }
],
features: [groupingFeature]
}

im using hidden filed invoice_number to group this grid and i have the output like this

28263

what i want to do is show the grouped invoice number in the group header. is it possible in extjs4? how to do it?

Regards

carol.ext
26 Sep 2011, 11:47 AM
Did you try using "name" instead of "invoice_number" in groupHeaderTpl ?

groupHeaderTpl: 'Invoice: {name} ...