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

Fix rows reorder when pagination is applied. #6973

Merged
merged 5 commits into from
Oct 1, 2023

Conversation

sammanan4
Copy link
Contributor

@sammanan4 sammanan4 commented Sep 13, 2023

When the pagination is activated and the rows are reordered on pages other than the first one, the order was not taking into account the page number and the page size. This commit changes the index at which the row needs to be inserted by accounting for the page size and page number.

🤔Type of Request

  • Bug fix

📝Changelog

  • Extensions

When the pagination is activated and the rows are reordered on pages other than the first one, the order was not taking into account the page number and the page size. This commit changes the index at which the row needs to be inserted by accounting for the page size and page number.
@wenzhixin
Copy link
Owner

Please provide an Online Example to show your problem. Thanks!

@sammanan4
Copy link
Contributor Author

sammanan4 commented Sep 24, 2023

@wenzhixin Please see https://examples.bootstrap-table.com/#extensions/reorder-rows.html
When trying to reorder the rows on any page other than the first one, and then change the page, you can see the ordering is not correct. Thanks.

sammanan4 and others added 2 commits September 24, 2023 19:01
Co-authored-by: 文翼 <wenzhixin2010@gmail.com>
Co-authored-by: 文翼 <wenzhixin2010@gmail.com>
@UtechtDustin
Copy link
Collaborator

This is an example using you're commit: https://live.bootstrap-table.com/code/UtechtDustin/16248
Please check the console, the reording is broken.

Uncaught SyntaxError: redeclaration of const pageNum
note: Previously declared at line 100, column 10

@sammanan4
Copy link
Contributor Author

@UtechtDustin I have fixed the redeclaration issue in the previous commit, please try to run again. I am not able to load the updated code in the live editor though.

@UtechtDustin UtechtDustin merged commit ae57afd into wenzhixin:develop Oct 1, 2023
1 check passed
@UtechtDustin
Copy link
Collaborator

Thank you for the contibution, the latest commit is in the cache of the used cdn.
I tested it locally, works fine.

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

Successfully merging this pull request may close these issues.

3 participants