首页 > 解决方案 > NG-ZORRO 中的表格过滤器

问题描述

我在我的 Angular 11 应用程序中使用 NG-ZORRO 的 nz-table 组件。当用户在文本框中输入时,我想要即时搜索功能。 这里这是我使用 nz-table 的 UI

根据他们的文档,我知道 NG-ZORRO 中有列级过滤器选项。

但是没有找到我想要的这样的功能。任何想法是否有办法做到这一点。

标签: angular11ng-zorro-antd

解决方案


您可以在 th 标签上添加过滤器属性 (nzFilterChange)。例如 :

filterChange(search: string) {
  // You can do the job here
}
<th (nzFilterChange)="filterChange($event)">Header</th>


推荐阅读