Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wire up UI for "limit" and "skip" values #6

Closed
gsavoie opened this issue Mar 16, 2016 · 9 comments
Closed

Wire up UI for "limit" and "skip" values #6

gsavoie opened this issue Mar 16, 2016 · 9 comments

Comments

@gsavoie
Copy link

gsavoie commented Mar 16, 2016

Hi,

Agendash works pretty well with my setup, only concern is the fact that there is no paging, and since we have like 20,000 jobs in the database the first load is very long...

Is it planned to add paging or some options to only get the first x jobs ?

@joeframbach
Copy link
Member

I did attempt this, and the issue came up that when you're looking at a certain page, like you're looking at page 3, the jobs on the page keep changing. Suppose you're looking at jobs 200 through 299 on a page. Well, sorting by date the jobs keep cycling and every time the data refreshes the jobs keep changing! Very annoying.

One solution is to add the ability to "pause" the refreshes. If you're looking at historical data on page 5, you may want to pause refreshes.

Another solution is, rather than doing paging like "page 1, page 2, page 3" like hackernews does it, instead do it like reddit does: Load the next 100 jobs that occur after the datetime "2016-03-15T17:33:00Z" or something like that.

So here are two possible solutions, feel free to add more possibilities. It is on my radar though! Thanks!

@joeframbach
Copy link
Member

Until then I will add a limit to get only the first x jobs like you suggested. That is a good suggestion. The ability to view historical data will then be a feature request in the future.

@gsavoie
Copy link
Author

gsavoie commented Mar 16, 2016

Ahh yeah I understand, thanks for your quick answer. I guess navigating the pages could stop the refresh, at least that's the simpliest way to resolve it

For the first x jobs it could be in the UI with a default value that we set in the code, so every time we open the page it loads quickly but we are still allowed to see more/all if needed... Since most of the time we want to see the recent things and not the whole collection that would help pretty much.

Anyway, just throwing ideas here!

@Unibozu
Copy link

Unibozu commented Mar 16, 2016

Just jumping on the thread - one way to solve this is to not think about pagination but about displaying results from a certain point (in time or in sequence). Using ObjectId makes is easy because they are incremental and comparable in time.
Instead of passing through a page parameter you can use a from parameter with the ID of the last job visible on the current page. The most annoying issue is that it stops you from showing all the pages and for you to use previous/next links.

@simison
Copy link
Member

simison commented Mar 30, 2016

This problem is also described here: https://www.discovermeteor.com/blog/pagination-problems-meteor/ with some suggestions, like publishing counts.

Also, just linking this here; https://github.com/expressjs/express-paginate

@joeframbach
Copy link
Member

Several people are running into this, and the solution may need more time to do "correctly". Until then I am suggesting this quick limit of 200: #15

Is this a good start?

@joeframbach joeframbach changed the title Any plan to add paging? Wire up UI for "limit" and "skip" values Apr 4, 2016
@joeframbach
Copy link
Member

#15 has been merged with a default value of 200. This Issue title now reflects the remaining work to wire up the UI controls.

@OmgImAlexis
Copy link
Member

If any of you have a chance the new vue branch should have pagination built in.

@koresar
Copy link
Contributor

koresar commented Jan 19, 2021

Pagination is now a thing in Agendash v2.

@koresar koresar closed this as completed Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants