AdaptTable for NG-ZORRO

Filtering in NG-ZORRO

Declare what a column filters by and the table builds the form: text with its operators, number and date ranges, multi-select checkboxes and a yes/no choice, each an NG-ZORRO control.

Filters opens as an anchored popover or as a drawer, with an AND/OR tree at the top for what one row of inputs cannot say. Header funnels filter one column in place, and every active filter shows as a chip that removes itself.

Filter state lives in the versioned URL, so a filtered view is a link someone can send.

The code

import { Component, input } from "@angular/core";
import type { ColumnDef } from "@adapttable/angular";
import { AdaptDataTable } from "@adapttable/ng-zorro";
import { filters } from "@adapttable/ng-zorro/filters";
import { headerFilters } from "@adapttable/ng-zorro/header-filters";

const columns: ColumnDef<Person>[] = [
  { key: "name", filter: "text" },
  { key: "team", filter: { type: "multiSelect", options: "auto" } },
  { key: "budget", filter: "numberRange" },
  { key: "hiredAt", filter: "dateRange" },
];

@Component({
  selector: "app-people",
  imports: [AdaptDataTable],
  template: `
    <adapt-data-table
      [data]="rows()"
      [columns]="columns"
      [rowKey]="rowKey"
      urlKey="f"
      filtersMode="popover"
      [features]="features"
    />
  `,
})
export class People {
  readonly rows = input.required<readonly Person[]>();
  readonly columns = columns;
  readonly rowKey = (row: Person) => row.id;
  readonly features = [filters([]), headerFilters()];
}

Install

pnpm add @adapttable/ng-zorro @adapttable/angular @adapttable/core ng-zorro-antd @angular/forms @angular/router

The same feature in the other kits

More NG-ZORRO features

Reference: filtering, filter-tree, url-state. More of this kit: AdaptTable for NG-ZORRO, or the live demo.