@angular-ru/cdk/virtual-table

The Angular Table Builder includes a comprehensive set of ready-to-use features covering everything from paging, sorting, filtering, editing, and grouping to row and column virtualization, and accessibility support.

Demo

$ npm install --save @angular-ru/cdk

After a few seconds of waiting, you should be good to go. Let's get to the actual coding! As a first step, let's add the virtual table provider to our app config (src/app.config.ts):

import {provideVirtualTable} from '@angular-ru/cdk/virtual-table';

export const appConfig: ApplicationConfig = {
  providers: [provideVirtualTable()],
};

Simple use

Next, let's declare the basic grid configuration. Edit src/app.component.ts:

import {Component} from '@angular/core';
import {MyData} from './my-data.interface';
import {VirtualTable} from '@angular-ru/cdk/virtual-table';

@Component({
  selector: 'app-root',
  imports: [VirtualTable],
  template: `
    <ngx-table-builder [source]="data"></ngx-table-builder>
  `,
})
export class AppComponent {
  public data: MyData[] = [
    {make: 'Toyota', model: 'Celica', price: 35000},
    {make: 'Ford', model: 'Mondeo', price: 32000},
    {make: 'Porsche', model: 'Boxter', price: 72000},
  ];
}

see: https://stackblitz.com/edit/ng-table-builder-simple

The ngx-table-builder provides a styled data-table that can be used to display rows of data. The ngx-table-builder is an customizable data-table with a fully-templated API, dynamic columns, and an accessible DOM structure. This component acts as the core upon which anyone can build their own tailored data-table experience.

Custom template

Filtering

Filtration:

Actions above filter the table and leave us with:

This example use filter table type CONTAINS. For other available types check TableFilterType

is-filterable input set to true also adds filer symbol to column, a click on it leads to open a filter which you can provide like this:

External filtering

If leave enable-filtering to be set false and set is-filterable to true it will allow using default filters but table builder will not filter source by its own rules, so you can handle it on your own

TODO:

Last updated