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

Changing the filter or sorting, while pagination is enabled, does not revert the table back to the first page #3671

Open
KarmaProd opened this issue Mar 21, 2022 · 8 comments
Labels
Feature Large feature update

Comments

@KarmaProd
Copy link

Describe the bug
When using pagination, after changing a filter or sorting, the tabulator page is not restored to first one. Please note that documentation states otherwise, and this behaviour was working in a previous version.

Tabulator Info
5.1.7

Working Example
example of bug: http://tabulator.info/docs/5.1/page
example of working version: http://tabulator.info/docs/4.1/page

To Reproduce
A step by step guide to recreate the issue:

  1. Go to http://tabulator.info/docs/5.1/page and move to the very first table (Overview)
  2. Click on button "2" on the bottom right to move to page two.
  3. Click on Rating in header to sort by rating
  4. Page is not restored to the first one.

Expected behavior
Page should be restored to page 1, as the documentation clearly states shortly after in that same page:
Note: Changing the filter, sorting or toggling a groups visibility, while pagination is enabled will revert the table back to the first page.

Desktop:

  • OS: Windows 10
  • Browser: Google Chrome
  • Version: 99.0.4844.74
@KarmaProd KarmaProd added the Possible Bug A possible bug that needs investigation label Mar 21, 2022
doublehrajput added a commit to doublehrajput/tabulator that referenced this issue Mar 25, 2022
@doublehrajput
Copy link
Contributor

doublehrajput commented Mar 25, 2022

Compare #3676 these changes .. I am assuming that it might cause problem in other Modules as well

@olifolkerd
Copy link
Owner

@doublehrajput Unfortunately those changes will result in a reset in horizontal scroll position, which is undesirable when not in paginated mode.

@olifolkerd olifolkerd added Feature Large feature update and removed Possible Bug A possible bug that needs investigation labels Mar 25, 2022
@olifolkerd
Copy link
Owner

Hey @KarmaProd

Thanks for point out the inconsistency here. As much as this is a regression against the previous version. i think it actually highlights a bigger problem with the current design paradigm.

At the moment scroll positions are preserved when a sort occurs (on local data) but not pagination. which is making the same action trigger different actions per module.

To make things more consistent i will make some improvements in the next update. all modules will maintain their current state on sort/filter and then i will add a sortPositionReset and filterPositionReset (or similar) setup option to allow control over whether this resets the table or not.

Cheers

Oli :)

@KarmaProd
Copy link
Author

KarmaProd commented Mar 25, 2022

Actually, I didn't mention something else I noticed. In my stable installation I use tabulator 5.0.7, and this bug is NOT present. But in the http://tabulator.info/docs/5.0/page documentation page the bug IS present. @olifolkerd do you know why?

@olifolkerd
Copy link
Owner

Because that uses local pagination not remote pagination, the issue isnt about pagination as such but the data source. a remote data source will result in data being reloaded a local source will result in it being refreshed

@KarmaProd
Copy link
Author

KarmaProd commented May 23, 2022

I am upgrading to 5.2.4. Any update about this small bug?

By now, I am applying this workaround:

treegrid.on("tableBuilt", function(){
    // Don't reset page on initial rendering
    treegrid.on("dataSorted", function(sorters, rows){
        treegrid.setPage(1);
    });
    treegrid.on("dataFiltered", function(filters, rows){
        treegrid.setPage(1);
    });
});

@mdmangus
Copy link

mdmangus commented Feb 7, 2023

I had to do the same as @KarmaProd for workaround. I am using 5.4.

It still shows in its docs:
Note: Changing the filter, sorting or toggling a groups visibility, while pagination is enabled will revert the table back to the first page.

@sinbino
Copy link

sinbino commented Feb 5, 2024

@olifolkerd
I am using tabulator 5.4 with remote pagination.
And i am required to keep the page on filter and sort change.
Tabulator5.4 always seems to reset the page back to 1 on filter and sort change.
Is there a corresponding option implemented for sortPositionReset and filterPositionReset?
Or is there a way to maintain the page?

Thank you in advance for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Large feature update
Projects
None yet
Development

No branches or pull requests

5 participants