[英]Refresh aggregation results in ag-grid
I have an ag-grid
with rows grouped by one column and I want to show in the same line (group header) a value taken from first row in the group. 我有一个
ag-grid
,行按一列分组,我想在同一行(group header)中显示从组中第一行获取的值。
I found out that I can use aggregation for this, but I also want to dynamically update rows and group header in accordance with this. 我发现我可以使用聚合,但我也想根据这个动态更新行和组头。
To update aggregation and group header I tried to use gridApi.recomputeAggregates()
, but this function refreshes the whole table on every call. 为了更新聚合和组头我尝试使用
gridApi.recomputeAggregates()
,但此函数在每次调用时刷新整个表。 Is it a right behavior? 这是一种正确的行为吗? How can I avoid it?
我怎么能避免呢?
You need to add valuePerser to your column defenition and parse the value as number. 您需要将valuePerser添加到列defenition并将值解析为数字。
colDef.valuePerser = 'Number(newValue)';
Check out the documentation about Change Detection . 查看有关更改检测的文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.