AdaptTable for ngx-bootstrap

Saved views in ngx-bootstrap

A view is the table's state — search, sort, filters and the column layout — saved under a name.

Save one from the views menu and pick it again later to put the table back the way it was. The list lives in this browser's storage, or in any store you hand savedViews.

The code

import { Component, input } from "@angular/core";
import type { ColumnDef } from "@adapttable/angular";
import { AdaptDataTable } from "@adapttable/ngx-bootstrap";
import { filters } from "@adapttable/ngx-bootstrap/filters";
import { savedViews } from "@adapttable/ngx-bootstrap/saved-views";

const columns: ColumnDef<Person>[] = [
  { key: "name", sortable: true },
  { key: "team" },
  { key: "budget", sortable: true },
];

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

Install

# Follow the kit setup guide for compatible peers
pnpm add @adapttable/ngx-bootstrap @adapttable/angular ngx-bootstrap@22.0.0 @angular/forms@^22 rxjs@^7.4.0

The same feature in the other kits

More ngx-bootstrap features

Reference: saved-views, url-state. More of this kit: AdaptTable for ngx-bootstrap, or the live demo.