Ag-grid 隐藏过滤列

Ag-grid hide filter column

我在 Ag-grid 中有自定义过滤器。根据本站实施: https://www.ag-grid.com/javascript-grid-filter-component

当我单击过滤器并输入一些值并单击 ApplyFilter 时,图标的过滤器显示在 header 中:

但是当我点击清除过滤器时,这个图标并没有消失。 如何隐藏这个图标?

根据docs,请同时使用isFilterActive函数

 isFilterActive(): boolean {
    return this.text != null && this.text !== '';
  }

和过滤onChange方法请调用此方法filterChangedCallback

onChange(newValue): void {
    if (this.text !== newValue) {
      this.text = newValue;
      this.params.filterChangedCallback();
    }
  }

这是工作Example请仔细阅读以获取更多信息。