how to show grouped value in Extjs 4 grid groupHeader?

老子叫甜甜 提交于 2019-12-24 15:33:23

问题


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

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


回答1:


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.



来源:https://stackoverflow.com/questions/7521567/how-to-show-grouped-value-in-extjs-4-grid-groupheader

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!