Thursday 21 April 2016

Can someone give me the big picture with pagination? (AngularJS Sails)

Dear all,I understand how to paginate with, say, the Waterline ORM in Sails (e.g., {page: x, limit: y}) and how to do front-end pagination with AngularJS. However, I am not sure how pagination on the front and back will interact.Suppose we have 1000 records in total that match some query.In the user interface, we can only comfortably show 20 per page.With these two things in mind, how could we generate pagination in order to maintain a fast and snappy user experience?It seems we should not be sending 1000 records back to the client and then doing front-end pagination on these 1000 records. Rather, we should just retrieve something like 60 records at a time and then do front-end pagination on those 60. If the user decides they want more results (travels past page 3), they can query the database for another 60 results and the pagination links would reflect the additional 60 results that come into the front-end data model.If someone could help me with the big picture logic of how this would work (no need for super specific implementation details), that would be really appreciated.Thanks.

Submitted April 21, 2016 at 06:25PM by LeeHyori

No comments:

Post a Comment