-
Notifications
You must be signed in to change notification settings - Fork 851
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
refactor pagination: change pager params #674
Conversation
change paginationMaxBlocks/paginationMinBlocks to use pager settings pager {minBlocks: 5, maxBlocks: 11} to allow future enhancements of pager. Set defaults to 5,11 if they are undefined. BREAKING CHANGE tableParams paginationMaxBlocks/paginationMinBlocks are updated to use pager {minBlocks: YY, maxBlocks: XX}
Couple of pointers about the commit:
Have a read of the following to make sure you got all the details: |
I've been thinking about the counts field: Is I think a reasonable test is to consider infinite scrolling. If infinite scrolling (#560) was added would it use the Looking at the #560, it does not. Therefore I conclude that the So this gives use: var setttings = {
/* snip */,
pager: {
counts: [10, 25, 50, 100],
maxBlocks: 11,
minBlocks: 5
}
} Can you add this to the current PR (#674). It should be a separate commit once you've amended your previous one. |
BTW, we're doing significant breaking changes here... that's acceptable in this case as we're pushing to get to a 1.0 release and the api needs tidying up... |
Revert edits to CHANGELOG.md
…bject Restructure of NgTableParams pager settings to be an object to allow for future enhancements counts, minBlocks, maxBlocks BREAKING CHANGE: Previously: ```` $scope.tableParams = new NgTableParams({ page: 1, // show first page count: 5, // count per page sorting: { name: 'asc' // initial sorting } }, { counts: [5, 10, 15], paginationMaxBlocks: 9, paginationMinBlocks: 5 }); ```` Now: ```` $scope.tableParams = new NgTableParams({ page: 1, // show first page count: 5, // count per page sorting: { name: 'asc' // initial sorting } }, { pager: { counts: [5, 10, 15], maxBlocks: 9, minBlocks: 5 } }); ````
@ccrowhurstram Read the docs, made most of the suggested changes, changing pushed commit messages looks messy. If every commit / commit message needs to be perfect then I will have to bow out from making further PR's. I understand the need for consistency but it seems like you know exactly what you want and I am not sure if my edits will be sufficient as I am fairly new to git / Angular / JS. |
OK, but shame as my time is going to run out shortly at least for the next couple of months so this change might not make it in. It can get fiddly for sure to amend a previous commit already pushed. However, it's definitely a good tool to have in your toolbox... |
change paginationMaxBlocks/paginationMinBlocks to use pager settings pager {minBlocks: 5, maxBlocks: 11} to allow future enhancements of pager. Set defaults to 5,11 if they are undefined.
BREAKING CHANGE tableParams paginationMaxBlocks/paginationMinBlocks are updated to use pager {minBlocks: YY, maxBlocks: XX}
PR 1 as suggested in #656 by @christianacca