You'd have to listen for item deletes/creates and use JS to asynchronously update the pagination link with a URL variable that you could intercept and alter the database query.
Sep 21, 2016
3
Level 5
Pagination with changing content
This is a known issue for every developer when using pagination. I did not found any simple solutions, except using something complicated like google pagination cursor.
We have the next scenario: Our pagination object has 5 items per page and 10 items in total
- Page 1 will display: item1, item2, item3, item4, item5
- We delete item4 and item5
- Page 2 will display: item8, item9, item10
- Issue: items6 and item7 disappears because they were moved in page 1
So the perfect scenario will be for Page 2 to display item6, item7, item8, item9 and item10
How can I accomplish this by using Laravel pagination, or anything else like a pagination library ?
Please or to participate in this conversation.