【问题标题】:AgGrid: How to change the aggregate values for some of the columns dynamically at run time?AgGrid:如何在运行时动态更改某些列的聚合值?
【发布时间】:2019-09-25 14:50:01
【问题描述】:

我正在使用 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
          }
    }
}

任何帮助将不胜感激。

谢谢

【问题讨论】:

    标签: ag-grid ag-grid-angular ag-grid-grouping


    【解决方案1】:

    试试这个

    columnApi.setColumnAggFunc(colKey, () => '')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-13
      • 1970-01-01
      • 2018-12-24
      • 2017-07-27
      • 1970-01-01
      • 2017-05-02
      • 2010-11-13
      • 1970-01-01
      相关资源
      最近更新 更多