В настоящее время у меня есть следующая таблица PrimeNG TurboTable:
<p-table [value]="People" >
<ng-template pTemplate="header">
<tr>
<th>Name</th>
<th>Age</th>
<th>Height</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-col>
<tr>
<td>{{col.Name}}</td>
<td>{{col.Age}}</td>
<td>{{col.Height}}</td>
</tr>
</ng-template>
</p-table>
Мне нужно иметь возможность фильтровать по столбцу «Возраст» при загрузке страницы, как мне это сделать? Во всех примерах, которые я смог найти, используется тег (input) или (onChange) примерно так (взято с их веб-сайта):
<input type="text" pInputText size="50" placeholder="Global Filter" (input)="dt.filterGlobal($event.target.value, 'contains')" style="width:auto">
Как я могу фильтровать по столбцу при загрузке, а не при изменении элемента?
Вот страница, на которую я ссылаюсь: https://www.primefaces.org/primeng/#/table/filter
Благодарю вас!
filterGlobal()
наngOnInit()
сfilter criteria
по мере необходимости. - person Abhijit Muke   schedule 09.03.2018