brunano21 / angular-4-data-table

An Angular 5 data table, with pagination, sorting, expandable rows, row selection, etc. with basic accessibility support.
MIT License
11 stars 19 forks source link

Filter #9

Closed DinukaGayan closed 6 years ago

DinukaGayan commented 6 years ago

Can you describe how to implement filter function in this?Column wise searching and All columns

brunano21 commented 6 years ago

You can rewrite the reloadTable function as the following, passing a second arg to the query function:

carResource = new DataTableResource(cars);

reloadTable() {
    this.carResource .query(params, **filterFunc**).then(cars => this.cars = cars);`
}

filterFunc signature is (item: T, index: number, items: T[]) => boolean)