ag-grid - AgGrid:如何在运行时动态更改某些列的聚合值?
问题描述
我正在使用 Ag 网格的行分组功能和我预定义的一些列aggFunc
。
我想要实现的是,一旦网格加载了所有数据,我想根据某些条件隐藏某些列的一些聚合值(行和叶子级)。
我检查了 AgGrid 的 API 文档并在下面进行了尝试,但不幸的是对我没有任何作用。
onButtonClick() {
this.gridApi.forEachNode((node, index) => {
if (node.field === 'xyz') {
// node.aggFunc.abc = 0; // not working
// node.aggData.abc = null; // not working
// node.setDataValue('abc', null); // not working
}
}
}
任何帮助,将不胜感激。
谢谢
解决方案
尝试这个
columnApi.setColumnAggFunc(colKey, () => '')
推荐阅读
- r - xpath 包含文本不适用于 or 运算符
- regex - 正则表达式匹配某些 xml 标签
- regex - 从文本文件中删除包含“(null)”值的行
- python - 无法访问首页标题(python-docx)
- visual-studio-code - 在创建 Lambda 函数时,使用 VS 代码的 aws 工具包在 template.yaml 中看不到 codelens 按钮“添加调试配置”
- android - 谷歌 Admob 导致 Unity 游戏崩溃
- routes - Valhalla 转弯路线 API
- android-connectionservice - 如何修复 java.lang.SecurityException:此 PhoneAccountHandle 未为此用户启用?
- android - 如果应用程序在后台运行时更改了设备语言,如何检查片段内部?
- c# - 用于一系列日期的日期字符串