Implementing NGX Datatable filtering on all columns

后端 未结 8 752
不知归路
不知归路 2021-02-06 04:21

I\'ve been trying to get this working with no luck. I\'ve been referencing these resources for help: http://swimlane.github.io/ngx-datatable/#filter
https://github.com/swiml

8条回答
  •  被撕碎了的回忆
    2021-02-06 04:43

     updateFilter(event) {
        const val = event.target.value.toLowerCase();
        const temp = this.temp.filter(index => {
          return (index.name.toLowerCase().indexOf(val) !== -1 ||
            index.company.toLowerCase().indexOf(val) !== -1 ||
            index.gender.toLowerCase().indexOf(val) !== -1 ||
            !val);
        });
        this.company = temp;
        this.table.offset = 0;
      }
    

提交回复
热议问题