Pagination with a REST API and a different endpoint for each page
Pagination with a REST API and a different endpoint for each page
I am having so many problems with this and am hoping someone here will help me figure this out. The way our API works is it returns the amount of records based on an offset number. So, say for the first page the request would be http://example.com/users/0
then the next page would be http://example.com/users/50 etc....
There should be a way with server side processing to get this working, but I can't figure it out. What I need is a way that when I change the pagination, it grabs the offset and sends a new request. Any ideas how I can get this to work?
Replies
You would need to use the
ajax
option as a function to do this.There isn't a built in option for it, since there is a lot more information being sent to the server rather than just the page offset (sorting and filtering for example), which would make the REST URL horrible.
Allan