Rank 2: Process
hi, I'm try to implement cursor pagination by look through the appwrite document and i still don't get it, could anyone send link any example code about it ?
Votes
0
Replies
21
Participants
Unknown
Messages
22
Rank 2: Process
hi, I'm try to implement cursor pagination by look through the appwrite document and i still don't get it, could anyone send link any example code about it ?
You can check this example, should give you a gist -
https://dev.to/appwrite/this-is-why-you-should-use-cursor-pagination-4nh5
Rank 2: Process
i already check it and still don't get it, what i need an example code how to implement a real project
Moderator
What you don't understand, basically triggering your get documents and in the query specify the page where you are
Rank 2: Process
I'm using this package https://terryz.github.io/vue3/page/#page-size-menu and i'm trying to implement it with cursor paginator, what i don't understand step process like when user click on previous or next
Moderator
When you click page 2, get documents as usually, with the difference you specify in your query this:
Query.offset(0)
Moderator
1 if you're in page 1, 2 if in page 2...
Rank 2: Process
i don't get it, why offset ?
Moderator
Offset = page
Rank 2: Process
i'm try to implement cursor pagination not offset
Moderator
Then you get latest document id and that way you get next elements
Rank 2: Process
how about previous ?
Rank 2: Process
anyone implement this ?
Moderator
First element you just don't set pagination query so you will get first 24 documents
Rank 2: Process
example : i have 3 pages , i click on page 3 and then i click on page 2 , how the query work ?
Moderator
For that you need standard pagination then
Moderator
Cursor pagination is for example to make an infinite scrolling screen
Moderator
You can implement too cursor pagination there, but I think it's worthless
Rank 2: Process
why is it worthless ?
Moderator
You will need to perform multiple queries so It will take practically the same time
Moderator
In other words you will not have practically any advantage
Rank 2: Process
ok, noted, thank you so much.