简体   繁体   English

避免 - ag-grid 中的聚合

[英]avoid - aggregation in ag-grid

i have ag-grid.我有农业网格。 This is the column structure -这是列结构 -

account share qty账户份额数量

i'm grouping by account (rowGroup = true).我按帐户分组(rowGroup = true)。 I have this sample data -我有这个样本数据 -

account帐户 share分享 qty数量
234 234 xny xny 4 4
234 234 ghy 3 3

this appears as这显示为

account帐户 share分享 qty数量
234 234 0 0
xny xny 4 4
ghy 3 3

note that 0 comes for qty.请注意,0 代表数量。 this is because i havenot provided any aggregateFunction to colDef.这是因为我没有向 colDef 提供任何聚合函数。 I want that qty cell to be empty for group level records (instead of showing a zero).对于组级别记录,我希望该 qty 单元格为空(而不是显示零)。 is there a way to do it?有办法吗?

I'm not sure if this is the correct way but I was able to solve this by checking if the row is a group level row in my value formatter.我不确定这是否是正确的方法,但我能够通过检查该行是否是我的值格式化程序中的组级别行来解决这个问题。

if the row is a group level row, i would return an empty string.如果该行是组级别行,我将返回一个空字符串。 otherwise, i would invoke the formatting function to show formatted data.否则,我会调用格式化 function 来显示格式化数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM