I'm trying to implement default filtering in my PrimeNg p-table based on user input. I believe I need to use something along the lines of
let table = document.getElementById("dt");
to access PrimeNG's table object and apply the desired filters using table.filter(filterDefault, col.field, 'in');
as shown in the HTML code snippet. However, I am unsure how to properly reference the #dt element in my TypeScript code or if there is a more straightforward method available within PrimeNG's p-table functionality.
<p-table #dt>
...
<tr>
<th *ngFor="let col of columns" [ngSwitch]="col.filterType" class=showOverflow pResizableColumn>
...
<p-multiSelect *ngSwitchCase="'DropDown'" [options]="masterSearchTypes" defaultLabel="All"
[(ngModel)]="filterDefault" (onChange)="dt.filter($event.value, col.field, 'in' )"></p-multiSelect>
</th>
</tr>
...
</p-table>