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
How do filter works when turbo table is lazy loaded?
-
- Posts: 449
- Joined: 08 Aug 2018, 14:09
You can't use basic filter with lazy load table. But you can use onLazyLoad event like that;
html;
component;
And you can create custom sort.
html;
Code: Select all
<p-table [columns]="cols" [value]="cars" [lazy]="true" (onLazyLoad)="loadCarsLazy($event)" [paginator]="true" [rows]="10" [totalRecords]="totalRecords">
</p-table>
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
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 18 guests