是否可以将独立过滤器与列过滤器一起使用?

Is it possible to use Standalone filter along with column filters?

我知道我们可以使用没有单独列过滤器的独立过滤器 (https://akveo.github.io/ng2-smart-table/#/examples/using-filters) 但是可以同时使用两者吗?

我尝试实现它但无法实现。参见 https://stackblitz.com/edit/angular-2cwakj?file=src%2Fapp%2Ffilter-poc%2Ffilter-poc.component.ts

使用以下函数更改您的 onSearch 函数。

  onSearch(query: string = '') {
   this.source = new LocalDataSource(this.data.filter((obj)=>{
   if(obj.id.toString().indexOf(query)>-1 || obj.name.indexOf(query)>-1 || 
    obj.username.indexOf(query)>-1 ||obj.email.indexOf(query)>-1 ) return true;
   else false;
  }))
 }