Add option to reset the persisted pagination Initial Page when the dataset is too small when accessing remote data
Hi,
Not sure if this is a bug or a misuse of Tabulator.
With remote data & remote pagination. When the current page is loaded from the persistence and the dataset is smaller ( has less pages ) making selecting the persisted page impossible, Tabulator shows an empty table.
This can happen when the rows of a table are deleted from the backend, when you reload the page the dataset is smaller.
Tabulator Info 5.3.4
Working Example https://jsfiddle.net/1c2tyhv9/1/
To Reproduce
- Open the fiddle
Expected behaviour
If the page is not existent, the paginationInitialPage should be reset
Thanks! Antonio
Hey @antman3351
What would be your desired outcome in this scenario,
The server should return an empty array as there are no rows on that page, then when it responds with a max page of less thatn the current page Tabulator should make a request to the highest page instead?
Cheers
Oli :)
Hi Oli,
Good question I hadn't given it much thought. As the value is invalid personally I'd start from page 1 but I can see how this could be annoying if it keeps throwing you back to the first page, so last page probably makes more sense.
Could it be a setting?
Thanks!
Hey @antman3351
Yeah an option sounds like a good idea,
I will set this as a feature request, and add it to the todo list for a future minor release (or feel free to submit a PR}
Cheers
Oli :)