Primeng 4 datatable global filter

277 Views Asked by At

I have used primeng 4 datatable in my project. I have used the global filter feature. I wanted the global filter to start filtering only after entering 3 characters. How to achieve this.

<input #searchInput pinputtext="" placeholder="Search By  Id / Name" size="50" type="text"
        #gf>

<p-dataTable #dt [globalFilter]="globFilter" [value]="gridResult" [lazy]="true" [rows]="recordsPerPage" [paginator]="true"
    [totalRecords]="totalRecords" (onLazyLoad)="lazyLoadfunction($event)">
1

There are 1 best solutions below

0
Mayur Saner On

you have to use same id into [globalFilter] as you have given to the input box and it starts filtering by single letter also you can try this:

<input #searchInput placeholder="Search By  Id / Name" size="50" type="text" >
<p-dataTable #dt [globalFilter]="searchInput" [value]="gridResult" [lazy]="true" [rows]="recordsPerPage" [paginator]="true"
    [totalRecords]="totalRecords" (onLazyLoad)="lazyLoadfunction($event)">