Reputation: 1293
I have implemented a PagingAndSortingRepository and displaying the domain object on the UI using DatatableJS.
I have pages and filters on the table. The problem I am facing is that I am doing findAll() which used to return about 100-200 rows, but now I have been asked to look at the DB as they are increasing the number of records to 1million and to retrieve that data its too long.
My question is how can I achieve Filtering on the UI (among all the 1 million records) and pagination using the existing components or should I have to re-write it? Are there any examples out there?
Upvotes: 0
Views: 516
Reputation: 3374
With a record set that size you will need to do your filtering on the server side, have a look here as a starting point.
Datatables will send ajax calls on keystrokes containing the search criteria that has been entered and the current page the user is viewing, and the number of records to display as a query string. You can then use this info to query the db and send back your pre-filtered result set for Datatables to render.
Upvotes: 1