tabulator icon indicating copy to clipboard operation
tabulator copied to clipboard

Add option to reset the persisted pagination Initial Page when the dataset is too small when accessing remote data

Open antman3351 opened this issue 3 years ago • 3 comments

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

  1. Open the fiddle

Expected behaviour If the page is not existent, the paginationInitialPage should be reset

Thanks! Antonio

antman3351 avatar Sep 30 '22 11:09 antman3351

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 :)

olifolkerd avatar Oct 03 '22 17:10 olifolkerd

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!

antman3351 avatar Oct 04 '22 07:10 antman3351

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 :)

olifolkerd avatar Oct 09 '22 09:10 olifolkerd