javascript - It's possible create filter per column in material angular? -


i develop web app angular 4 have problem table, because newbie in don't understand correct flow in table component, copy example material.angular.io https://plnkr.co/edit/?p=preview, can't create filters per column, try create more filters in html , try render these, implementation take 1 @ time, , ignoring rest.

i create these filters in datable.component.ts (containing modified plnkr).

@viewchild('filterobra') filterobra: elementref; @viewchild('filterst') filterst: elementref; @viewchild('filterfolio') filterfolio: elementref; @viewchild('filterprofesional') filterprofesional: elementref; 

in ngoninit add per each filter

observable.fromevent(this.filterobra.nativeelement, 'keyup')       .debouncetime(150)       .distinctuntilchanged()       .subscribe(() => {         if (!this.datasource) { return; }         this.datasource.filterobra = this.filterobra.nativeelement.value;       }); 

in ultimate class exampledatasource again add each filter.

get filterobra(): string { return this._filterchange.value; }   set filterobra(filterobra: string) { this._filterchange.next(filterobra); } 

my idea add filters per column , other filters ignored , not complemented in search, idea if 2 filters used both considered in result of table, @ least has clear example on how this? or how in angularjs?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -