Elements icon indicating copy to clipboard operation
Elements copied to clipboard

Pager two-ways?

Open mario opened this issue 4 years ago • 5 comments

From what I can understand the docs, the pager would fire when you reach the bottom. Can I have it fire when it reaches top as well, and if I can, how?

Thanks in advance for your assistance!

mario avatar Jan 03 '20 22:01 mario

You can choose when to trigger new pages by passing in a Pager with setPager (look at the implementations that are already available to see how it works!).

However, Pagers request new pages at the end of the current dataset - we don't support the concept of a "page -1" (before page 0). You might be able to achieve what you want anyway but it will require some workarounds in your source implementation.

natario1 avatar Jan 03 '20 23:01 natario1

Well, it's also the end if you go to the beginning - just a different end. I'll take a look, thank you.

mario avatar Jan 03 '20 23:01 mario

I would assume you don't plan on implementing something like this either?

mario avatar Jan 05 '20 21:01 mario

I have no time for it, sorry! It would also require significant changes, both internally and in the API surface, which would complicate the concepts (page numbers for instance, would make no sense anymore...) only for the benefit of this use case.

But I would welcome a solution that does not mess with the current state too much. Maybe using negative page numbers? If you want to take a look yourself and need help, feel free to comment here.

natario1 avatar Jan 05 '20 21:01 natario1

I'll try to take a look in the coming days/months as I'd like to use what you have here. Thanks for your offer to help :)

mario avatar Jan 05 '20 21:01 mario