Im using Angular 7 and PrimeNg library.
I have my p-table delaration:
<p-table #tasktable [columns]="displayedColumns" [value]="Tasks" [globalFilterFields]="['name']" [paginator]="true" paginatorPosition="both"
rows="20" [autoLayout]="true" selectionMode="single" [(selection)]="selectedTask"
[reorderableColumns]="true" >
Then I have the text input for the global filter:
<input type="text" pInputText size="50" placeholder="Search by Task name" [(ngModel)]="filterFromUrl" (input)="tasktable.filterGlobal($event.target.value, 'contains')" style="width:auto">
So far so good. sometimes i get a parameter inside my URL, to get it I used in my component.ts:
this.activatedRoute.queryParams.subscribe(params => {
this.filterFromUrl = params['task'];
});
And now I have the parameter from the URL in my filterFromUrl parameter. My problem:
I cant get the table filter the data by the parameter.
I used [(ngModel)] bind in the ,it doesn't work,
I can see the parameter on the search control:
But it just doesn't fire the event and the data not filtered.