Pager: Hiding irrelevant page size controls#656
Conversation
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.
|
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 settingsThe 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 buttonsThe 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 |
|
There's a pull request to implement infinite scroll (#560) As commented:
|
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.