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 ?
what is the issue you are facing can you please elaborate more?
html =>
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
Most helpful comment
You have to filter it yourself at backend in lazy mode.