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

Pager: Hiding irrelevant page size controls #656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gatapia
Copy link

@gatapia gatapia commented Jul 16, 2015

Page size controls are always displayed even if they are irrelevant to current dataset. I..e Say we have 10, 20, 50 page size controls. There is no need to show any when there is only 3 items on the list. There is also no need to show 50 if there are only 15 items in the list.

Page size controls are always displayed even if they are irrelevant to current dataset.  I..e Say we have 10, 20, 50 page size controls.  There is no need to show any when there is only 3 items on the list.  There is also no need to show 50 if there are only 15 items in the list.
@christianacca
Copy link
Collaborator

Hi Guido,

Thanks for your pull request.

I think your suggestion is a good one, but...

I can see that for some screens you'd always want to see the page size controls and other times you wouldn't.

We could make this a config option but more options can sometimes make working with a library harder.

That said, it could be a good time to consolidate the existing options determining how the pager is displayed. Once consolidated they would have more "room to grow".

Once consolidate, a new pager option can be added that determines whether to always display the page size.

Can you do this?

If so, can you create two pull requests to replace this current one.

Pull request 1 - refactor pagination settings

The first pull request would be a refactoring of the existing settings.

Change this:

var settings = {
    /* snip */,
    counts: [10, 25, 50, 100],
    paginationMaxBlocks: 11,
    paginationMinBlocks: 5,
}

To this:

var setttings = {
    /* snip */,
    counts: [10, 25, 50, 100],
    pager: {
        maxBlocks: 11,
        minBlocks: 5
    }
}

Pull request 2 - add option to always show page size buttons

The default for this new option should be true I think. But because settings can be globally overridden already, an app could choose to change this default value.

C

@christianacca
Copy link
Collaborator

There's a pull request to implement infinite scroll (#560)

As commented:

... separate out pager options and page generation logic from NgTableParams
... someone to take the lead on this

@christianacca
Copy link
Collaborator

So looks like we have a bunch of options for pagination: #556, #555, #648, #656 (this one), #560, #454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants