首页 > 解决方案 > 仅当用户按下 ok 时确认 Ng Zorro 过滤器中的选择复选框

问题描述

我有个问题。我使用 ng-zorro 通过带有复选框和 nzShowFilter 组件的下拉菜单过滤表中的数据。

我希望只有在用户按下“确定”时才会应用选择。目前,如果我选择一个复选框并关闭过滤器,则会执行过滤。我只希望在用户确认时发生这种情况,否则,必须撤消最后的更改。

  <th scope="col" nz-th nzShowFilter   [nzFilters]="listOfEmployee" (nzFilterChange)="filter($event,'employee')">Employee</th>

  <th scope="col" nz-th nzShowFilter [nzFilters]="listOfType" (nzFilterChange)="filter($event,'type')">Type</th>
  <th scope="col" nz-th nzShowFilter [nzFilters]="listOfProjects" (nzFilterChange)="filter($event,'projects')">Projects</th>
  <th scope="col" nzCustomFilter>
    Date
    <nz-filter-trigger [(nzVisible)]="visible" [nzDropdownMenu]="menu">
      <i nz-icon nzType="calendar" nzTheme="outline"></i>        </nz-filter-trigger>
  </th>
  <th scope="col">Hours</th>
  <th scope="col" nzWidth="120px">Actions</th>
</tr>

标签: angulartypescriptng-zorro-antd

解决方案


推荐阅读