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

Removing the last item in a Trackable collection breaks paginated grid #1192

Closed
maier49 opened this issue Oct 5, 2015 · 1 comment
Closed
Assignees

Comments

@maier49
Copy link
Contributor

maier49 commented Oct 5, 2015

After removing the last item in a paginated grid's trackable collection the navigation displays negative numbers. Additionally, once the grid is in this state new rows added to the trackable collection are not rendered by the grid. This JSFiddle demonstrates this bug: http://jsfiddle.net/jL3qrm0a/1/ on master, but it exists in at least 0.4.0 as well.

@maier49
Copy link
Contributor Author

maier49 commented Oct 5, 2015

I believe the issue is caused by _onNotification passing 0 as a page number to gotoPage. Changing these lines: https://github.com/SitePen/dgrid/blob/bbc904cc4ae6516617591c7aa630e7cc32fcdc00/extensions/Pagination.js#L463-L466 by adding || 1 in the call to gotoPage , or wrapping the argument in a Math.max(0, ... if we are concerned about potentially passing a negative page number resolves the issue.

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

2 participants