phelhe
phelhe

Reputation: 779

Primeng p-table: how to reset custom filters? Calling reset() resets the table but the value of my filters remains unchanged

How can I reset all of the column filters? Calling reset() seems to reset the table but all the fields of the filters remain unchanged.

Upvotes: 3

Views: 3791

Answers (1)

Shlomo Zalman Heigh
Shlomo Zalman Heigh

Reputation: 3978

You can bind the input values to the table's filters, like this:

<input type="search" (input)="table.filter($event.target.value, 'FieldName', 'contains')" [value]="table.filters['FieldName']?.value" />

Notice the [value] binding.

Upvotes: 2

Related Questions