Closed carlosalvidrez closed 4 years ago
You can't instantiate to the last page, since you first need to make a subscription to the server to get the number of pages.
Why don't you sort in reverse so there's no need to start at the last page?
To switch to the last page after the first init, you could keep a local variable (isInit = true
) and after the subscription is done and you have the total number of pages modify it (isInit = false
) together with setting the currentPage
and any subsequent for isInit
will fail so currentPage won't be modified, thus ensuring there won't be a loop.
Thank you, I will give that a whirl this week. I truly appreciate it.
Hi, wondering if it is possible to instantiate the client pagination object to start at the last page.
I'm having trouble right now because it loads at page 1, then I get the number of pages, and then I set the object's currentPage to totalPages, but it gets stuck in an infinite loop.
Any help will be appreciated. Thanks!!