我在此处设置了一个农业网格行组示例:https://plnkr.co/edit/lOOhfLcpuNbIgXO5e7Wy?p=preview
var columnDefs = [
{
headerName: 'country',
rowGroup: 'true',
showRowGroup: true,
cellRenderer:'agGroupCellRenderer',
field: 'country',
cellRendererParams: {
suppressCount: true,
checkbox: false,
innerRenderer: 'simpleCellRenderer',
suppressDoubleClickExpand: true,
suppressEnterExpand: true
}
},
{headerName: 'City', field: 'city', cellRenderer:'agGroupCellRenderer', cellRendererParams: {
suppressCount: true,
checkbox: false,
innerRenderer: 'simpleCellRenderer',
suppressDoubleClickExpand: true,
suppressEnterExpand: true
}}
];
在此示例中,我将抑制计数指定为true,此后,我希望仅看到国家/地区的行数,但是网格显示的总行数为27。如何使其仅对唯一国家/地区计数,而忽略每个城市的行。
参考:https://www.ag-grid.com/javascript-grid-cell-rendering/#gsc.tab=0