For the HTML I needed # id, I used #team
Code: Select all
<p-table #team id='team-grid' [value]='selectedTeam' dataKey='value'>
...
</p-table>
Code: Select all
import { Component, OnInit, ViewChild } from '@angular/core';
...
export class ProjectTeamMemberComponent implements OnInit {
...
@ViewChild('team', { static: true }) teamTable: Table;
...
ngOnInit(): void {
this.teamTable.filter( 3, 'Action', 'notEquals')
...
}
}
Code: Select all
this.teamTable.globalFilterFields = ['Action'];
this.teamTable.filterGlobal( 3, 'notEquals' );