Skip to content
New issue

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

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

Already on GitHub? # to your account

data table should not paginate past the end #1503

Closed
gordonwoodhull opened this issue Nov 28, 2018 · 1 comment
Closed

data table should not paginate past the end #1503

gordonwoodhull opened this issue Nov 28, 2018 · 1 comment

Comments

@gordonwoodhull
Copy link
Contributor

If the data table has beginSlice set and the data gets filtered so there are less records than that value, then nothing is displayed. One has to go to the last page to show stuff again.

It should either

  • page up to where there is data, or
  • reset entirely

Problem with the first option is that we don't really know the page size - it's technically just a slice. But it's probably fine to subtract some multiple of endSlice - beginSlice to get back in bounds.

@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Nov 30, 2018

By design beginSlice and endSlice are really stupid and it's up to the client to keep them sensible.

A good place to keep this in check is the preRedraw handler for the table, and I added handling based on the nice pagination system @HamsterHuey developed, contributed by @dadokkio in #1492.

The updated example will be published in 3.0.9. I think that's sufficient.

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

No branches or pull requests

1 participant