diff --git a/src/app/components/components/data-table/data-table.component.html b/src/app/components/components/data-table/data-table.component.html index 64ca17a707..55e92ee614 100644 --- a/src/app/components/components/data-table/data-table.component.html +++ b/src/app/components/components/data-table/data-table.component.html @@ -324,19 +324,19 @@

No results to display.

// .. do something with event.row } - filter(): void { + async filter(): Promise { let newData: any[] = this.data; - let excludedColumns: string[] = this.columns + let excludedColumns: string[] = await this.columns .filter((column: ITdDataTableColumn) => { return ((column.filter === undefined && column.hidden === true) || (column.filter !== undefined && column.filter === false)); }).map((column: ITdDataTableColumn) => { return column.name; }); - newData = this._dataTableService.filterData(newData, this.searchTerm, true, excludedColumns); + newData = await this._dataTableService.filterData(newData, this.searchTerm, true, excludedColumns); this.filteredTotal = newData.length; - newData = this._dataTableService.sortData(newData, this.sortBy, this.sortOrder); - newData = this._dataTableService.pageData(newData, this.fromRow, this.currentPage * this.pageSize); + newData = await this._dataTableService.sortData(newData, this.sortBy, this.sortOrder); + newData = await this._dataTableService.pageData(newData, this.fromRow, this.currentPage * this.pageSize); this.filteredData = newData; } } diff --git a/src/app/components/components/data-table/data-table.component.ts b/src/app/components/components/data-table/data-table.component.ts index 868ddcbfd4..8211ecea13 100644 --- a/src/app/components/components/data-table/data-table.component.ts +++ b/src/app/components/components/data-table/data-table.component.ts @@ -156,19 +156,19 @@ export class DataTableDemoComponent implements OnInit { this.filter(); } - filter(): void { + async filter(): Promise { let newData: any[] = this.data; - let excludedColumns: string[] = this.columns + let excludedColumns: string[] = await this.columns .filter((column: ITdDataTableColumn) => { return ((column.filter === undefined && column.hidden === true) || (column.filter !== undefined && column.filter === false)); }).map((column: ITdDataTableColumn) => { return column.name; }); - newData = this._dataTableService.filterData(newData, this.searchTerm, true, excludedColumns); + newData = await this._dataTableService.filterData(newData, this.searchTerm, true, excludedColumns); this.filteredTotal = newData.length; - newData = this._dataTableService.sortData(newData, this.sortBy, this.sortOrder); - newData = this._dataTableService.pageData(newData, this.fromRow, this.currentPage * this.pageSize); + newData = await this._dataTableService.sortData(newData, this.sortBy, this.sortOrder); + newData = await this._dataTableService.pageData(newData, this.fromRow, this.currentPage * this.pageSize); this.filteredData = newData; }