T
TanStack5mo ago
unwilling-turquoise

Misunderstanding manual pagination

Hello! I don't think I understand how manual pagination is supposed to work. The data I work with is paginated via server - that works fine as it is. If I read the docs correctly there https://tanstack.com/table/latest/docs/guide/pagination#page-count-and-row-count, then all I need to do is provide rowCount, is that not right? Because I do provide it but something isn't working correctly. table.getCanPreviousPage() and next area always false on page 0. And if the page is not 0, then they're always true. Both of them. I've verified this with:
console.log(table.getState().pagination);
console.log("show previous?", table.getCanPreviousPage())
console.log("show next?", table.getCanPreviousPage())
console.log(table.getState().pagination);
console.log("show previous?", table.getCanPreviousPage())
console.log("show next?", table.getCanPreviousPage())
the pagination state looks correct, but the functions aren't working as expected.
{
"pageIndex": 19,
"pageSize": 10
}
show previous? true
show next? true
{
"pageIndex": 19,
"pageSize": 10
}
show previous? true
show next? true
Regarding pagination, all I provide is manualPagination: true and rowCount.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?