How do filter works when turbo table is lazy loaded?

UI Components for Angular
Post Reply
AswathyM
Posts: 3
Joined: 01 Feb 2019, 14:30

01 Feb 2019, 14:40

Hi

I have implemented lazy loading in my table as the dataset is huge. Now I want to implement multiselect filter in each column to filter data in grid. How can I acheive it? It's quite very tedious to write custom function. Do we have any option to acheive this?

Thanks
Aswathy

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

04 Feb 2019, 08:52

You can't use basic filter with lazy load table. But you can use onLazyLoad event like that;
html;

Code: Select all

<p-table [columns]="cols" [value]="cars" [lazy]="true" (onLazyLoad)="loadCarsLazy($event)" [paginator]="true" [rows]="10" [totalRecords]="totalRecords">
</p-table>
component;

Code: Select all

loadData(event: LazyLoadEvent) {
    //event.first = First row offset
    //event.rows = Number of rows per page
    //event.sortField = Field name to sort in single sort mode
    //event.sortOrder = Sort order as number, 1 for asc and -1 for dec in single sort mode
    //multiSortMeta: An array of SortMeta objects used in multiple columns sorting. Each SortMeta has field and order properties.
    //filters: Filters object having field as key and filter value, filter matchMode as value
    //globalFilter: Value of the global filter if available
    this.cars = //do a request to a remote datasource using a service and return the cars that match the lazy load criteria
}
And you can create custom sort.

mkaur
Posts: 1
Joined: 16 Aug 2022, 14:51

16 Aug 2022, 14:53

how to use filter on lazy load event?

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests