我了解我们可以使用不带单个列过滤器的独立过滤器(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;
}))
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句