groupSuppressAutoColumn无法使用动态列Def-ag栅格角度



我正在尝试使用"agGroupCellRenderer"创建自定义rowGrouping。但在使用行组面板拖动功能创建新的行组后,网格数据将消失。

https://plnkr.co/edit/cGmrnc2LecpFhttY?preview

我正在尝试更新columnDef

columnRowGroupChanged(event) {
this.columnDefs = [
{
headerName: 'Country',
minWidth: 200,
showRowGroup: 'country',
cellRenderer: 'agGroupCellRenderer',
},
{
headerName: 'Year',
minWidth: 200,
showRowGroup: 'year',
cellRenderer: 'agGroupCellRenderer',
},
{
headerName: 'athlete',
minWidth: 200,
showRowGroup: 'athlete',
cellRenderer: 'agGroupCellRenderer',
},
{
field: 'country',
rowGroup: true,
hide: true,
},
{
field: 'year',
rowGroup: true,
hide: true,
},
{
field: 'athlete',
rowGroup: true,
hide: true,
},
{ field: 'gold' },
{ field: 'silver' },
{ field: 'bronze' },
];

}

检查附加图像

this.gridColumnApi.purgeInfiniteCache();
this.columnDefs = [
{
headerName: 'Country',
minWidth: 200,
showRowGroup: 'country',
cellRenderer: 'agGroupCellRenderer',
},
{
headerName: 'Year',
minWidth: 200,
showRowGroup: 'year',
cellRenderer: 'agGroupCellRenderer',
},
{
headerName: 'athlete',
minWidth: 200,
showRowGroup: 'athlete',
cellRenderer: 'agGroupCellRenderer',
},
{
field: 'country',
rowGroup: true,
hide: true,
},
{
field: 'year',
rowGroup: true,
hide: true,
},
{
field: 'athlete',
rowGroup: true,
hide: true,
},
{ field: 'gold' },
{ field: 'silver' },
{ field: 'bronze' },
];
}

最新更新