I want to use GlobalFilter of PrimeNG on my p-datatable on only employeeid and name columns... I have 5 other columns also in this table but I dont want to use globalfilter for them, and also the requirement is only globalfilter, otherwise I could have done column filter. How can I do it ?
I searched about it, it is possible in p-table, but I want to do it with p-datatable.
Here is my code :
<div class="md-input-wrapper">
<input #gb type="text" pInputText size="50" class="md-form-control md-valid"
placeholder="Global Filter" />
</div>
<p-dataTable [globalFilter]="gb" [value]="employees" class="table table-hover"
[paginator]="true" [rows]="10" [pageLinks]="3">
<p-column field="employeeid" header="Emp ID" [sortable]="true"></p-column>
<p-column field="name" header="Name" [sortable]="true" ></p-column>
you can use use p-table I don't they have datatables anymore. PrimeNg table has lots of options and very good documentation. Hope this will help. I have not tried this code though. You can also change the match mode to any of the following:
"startsWith", "contains", "endsWith", "equals", "notEquals", "in", "lt", "lte", "gt" and "gte"