admin管理员组文章数量:1389956
I have the following AgGrid React table:
const headers: ColGroupDef[] = [
{
headerName: '',
children: [
{
headerName: 'IBU/Mandate',
field: 'IBU/Mandate',
rowGroup: true,
hide: true
},
{
headerName: 'subgroup',
field: 'subcategory',
rowGroup: true,
hide: true
}
]
},
....
];
<AgGridReact
columnDefs={headers}
rowData={data}
pagination={true}
paginationPageSizeSelector={false}
theme={tableTheme}
suppressRowHoverHighlight={true}
domLayout='autoHeight'
onCellClicked={onCellClicked}
groupAllowUnbalanced={true}
suppressAggFuncInHeader={true}
groupDefaultExpanded={1}
groupDisplayType='multipleColumns'
/>
Some of the data can show up without having subcategory so in that case I want to disable expanding that IBU/Mandate row because on expand it will just replicate the row again.. I tried doing so using autoGroupColDef but didn't manage to get it working although it picks up the rows that have this condition correctly:
const autoGroupColumnDef = {
cellRendererSelector: (params: any) => {
if (params.data && params.data.subcategory === null) {
return undefined
}
return {
component: 'agGroupCellRenderer',
params: {
suppressCount: true,
},
};
},
};
Any idea on what I'm doing wrong?
本文标签: ag gridHow to disable row expand when doing multipleColumns row groupingStack Overflow
版权声明:本文标题:ag grid - How to disable row expand when doing multipleColumns row grouping - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744658142a2618084.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论