jbetancur / react-data-table-component

A responsive table library with built-in sorting, pagination, selection, expandable rows, and customizable styling.
https://react-data-table-component.netlify.app
Apache License 2.0
2.04k stars 411 forks source link

[FEATURE]: Server-side pagination #1171

Closed talhameer closed 6 months ago

talhameer commented 11 months ago

Feature Checklist

Is your feature request related to a problem? Please describe

In my app where I'm using the react data table component, I've a very large amount of data, so I've implemented pagination on the server side to make the API response optimized... But unfortunately, the library doesn't support the server-side pagination yet...

ZenHarbinger commented 7 months ago

I got around this by tracking: onChangeRowsPerPage, onChangePage, onSort Then I can send a request to the server to get data based on the desired sorting with an offset and limit based on what page I am on and the pageSize. Any data returned from the server should also have a total length count to set paginationTotalRows.

talhameer commented 6 months ago

Thanks @ZenHarbinger. I already have fixed this issue the way you mentioned. Actually, I was missing totalRowCount back then.