开发者

how to show grouped value in Extjs 4 grid groupHeader?

开发者 https://www.devze.com 2023-04-07 00:59 出处:网络
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\" : \"\"]})\

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

how to show grouped value in Extjs 4 grid groupHeader?

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


found the solution. i though i had to put group column name here

groupHeaderTpl: 'Invoice: {invoice_number} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'

but once i replace it with Invoice: {name}

value of the group column shows.

0

精彩评论

暂无评论...
验证码 换一张
取 消