Background: Using Metronic Tailwind version with nextjs.
Question:
How to load all data once spanning multiple pages in the datatable from the remote data source and show it paginated.
Currently if i return all data which is more than the page size it displays all records on the first and only page, instead of paginating it on multiple pages.
Hi Qamer Farooq
The KTDataTable is designed with two primary pagination modes:
- Server-side pagination: Where the API returns only one page of data per request
- Local pagination: Where all data is loaded and paginated client-side
Currently when you return all your data from the API, it's displaying everything on a single page because the pagination logic isn't being applied properly to your remote data.
You need to use a custom mapResponse handler that processes all your data at once but still supports pagination. Here's how to implement this:
https://gist.github.com/faizalmy/3bca5b0cf9877d0127fd832d32b70d62