0

我正在使用 ExtJs 4.1 网格并添加了组功能。在商店中,我指定了 groupField 和分组功能工作正常。但是当网格呈现时,组标题显示为组:组名称“。如何防止“组”关键字出现在组标题中(在下图中突出显示)。

在此处输入图像描述

Ext.require(['Ext.data.*', 'Ext.grid.*']);
Ext.onReady(function() {
   Ext.regModel('Teams', {
       fields: ['name', 'sport']
   });

   var teamStore = new Ext.data.Store({
       model: 'Teams',
       sorters: ['sport','name'],
       groupField: 'sport',
       data: [
           { name: 'Aaron', sport: 'Table Tennis' },
           { name: 'Aaron', sport: 'Football' },
           { name: 'Abe', sport: 'Basketball' },
           { name: 'Tommy', sport: 'Football' },
           { name: 'Tommy', sport: 'Basketball' },
           { name: 'Jamie', sport: 'Table Tennis' },
           { name: 'Brian', sport: 'Basketball' },
           { name: 'Brian', sport: 'Table Tennis' }
       ]
   });

   var grid = new Ext.grid.GridPanel({
       renderTo: Ext.getBody(),
       store: teamStore,
       width: 400,
       height: 300,
       title: 'Sports Teams',
       features: [{
           ftype: 'grouping'
       }],
       headers: [{
           text: 'Name',
           flex: 1,
           dataIndex: 'name'
       },{
           text: 'Sport',
           dataIndex: 'sport'
       }]
   });
});
4

1 回答 1

-1
features: [{
        ftype: 'grouping',
        groupHeaderTpl: '{name}'
    }]
于 2020-04-20T08:27:46.740 回答