FWIW I think I'd use the offset as well
Ok, but how do you do?
From what I see the offset allow you to get the element starting from a certain point.
How do you create an offset? How do we use this to say start from the X rows?
The offset from what I see is not the id of a row. It's in a form "itr-something/id".
This is ok if you do a infinite pagination but in the case of a carousel, I am a bit confuse.
I can play to get the previous one by reversing the order and the next one using the ascendant and only put the result to one element. However, I am stuck with the creation of the offset.
Ok, but how do you do?
From what I see the offset allow you to get the element starting from a certain point.
How do you create an offset? How do we use this to say start from the X rows?
The offset from what I see is not the id of a row. It's in a form "itr-something/id".
This is ok if you do a infinite pagination but in the case of a carousel, I am a bit confuse.
I can play to get the previous one by reversing the order and the next one using the ascendant and only put the result to one element. However, I am stuck with the creation of the offset.
Yeah, once we make the first call we'll get the offset and store it, and then you'd create your own logic to store the order and use the offset as needed?
Example workflow:
1. Your carousel has 3 items, so your initial query has a pageSize of 3 and you store the offset that came with that (offset1)
2. The user hits the right arrow to see the next 3 items, so you do another query and send the stored offset (offset1)
- You get a new offset back, so you store it (offset2)
3. User hits right arrow again, so you send offset2 with your query and display the received data
- You get a new offset back, so you store it (offset3)
4. User hits left arrow, so you send offset1 with your query to display the data the user expects
(I'd probably just grab all the relevant records from a view that was sorted / filtered as needed and then use that data, really, but I assume you've got some sort of business requirement that prevents that)