Primeng: Filtering is not working with Virtual scroll (Lazy loading) in PrimeNG data table. Filtering and lazy loading don't work together

Created on 19 Aug 2017  路  4Comments  路  Source: primefaces/primeng

Filtering is not working with Virtual scroll (Lazy loading) in PrimeNG data table. Filtering and lazy loading don't work together.

Is there is other alternative solution ?

Most helpful comment

You have to filter it yourself at backend in lazy mode.

All 4 comments

what is the issue you are facing can you please elaborate more?

html =>
[lazy]="true" [totalRecords]="totalRecords" (onLazyLoad)="loadCarsLazy($event)">

component =>
loadCarsLazy(event: LazyLoadEvent) {
//for demo purposes keep loading the same dataset
//in a real production application, this data should come from server by building the query with LazyLoadEvent options

   setTimeout(() => {
        if(this.datasource) {
            this.carsLarge = this.datasource.slice(event.first, (event.first + event.rows));
        }
    }, 250);

}

if we enable filter="true",then filtering is not working with lazy load.You can see by enable filter="true" in below demo link :=>
http://plnkr.co/edit/V3JY3MASoc1Dh2pm5IJO?p=preview

You have to filter it yourself at backend in lazy mode.

@cagataycivici I agree but how to pass column reference in the lazy load callback when user filters particular column.

Right now, when user do column search lazy load callback is called with event, how to pass column reference and search value text to the lazy load callback

Was this page helpful?
0 / 5 - 0 ratings