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

Sorting with paginationServer true and sortServer false: [ Remove hardcoded currentPage: 1 from tablereducer ] #729

Closed
5 tasks done
vijicode opened this issue Dec 4, 2020 · 4 comments
Assignees
Labels
next The next version (beta) wontfix This will not be worked on
Milestone

Comments

@vijicode
Copy link

vijicode commented Dec 4, 2020

Feature Check list

  • Agree to the Code of Conduct
  • Read the README to ensure the feature is not already present
  • You read Creating Issues, Features and Pull Requests
  • Considered the value versus complexity for all users of the library as well as library maintenance
  • Considered if this can be a storybook or documentation example

Is your feature request related to a problem? Please describe

A clear and concise description of what the feature is.
Please refer to #466
This can be fixed by removing the hardcoded page "1" in tableReducer.js
If we want only the data displayed in the current page to be sorted, and user is already at a particular page, it will be nice to keep the user on the current page instead of sending them to page 1.

Describe the solution you'd like

If sortServer is false, and paginationServer is true, edit logic to avoid setting currentPage to 1
OR
Create a new prop persistCurrentPageOnSort that keeps currentPage on sort in case of server-side pagination.

A clear and concise description of what you want to happen.

In tableReducer.js -> SORT_CHANGE, add logic described in the solution.
Example:
const keepPage = pagination && paginationServer && persistCurrentPageOnSort;
currentPage: keepPage ? state.currentPage : 1,

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

@vijicode
Copy link
Author

vijicode commented Dec 5, 2020

Made a PR #730
Could you please review whenever you get a chance. Thank you.

@jbetancur
Copy link
Owner

Hey, @vijicode thanks for the PR! It's been hectic but will look as soon as I can.

@jbetancur jbetancur self-assigned this Dec 29, 2020
@jbetancur jbetancur added this to the RDT Next milestone Dec 29, 2020
@jbetancur jbetancur added the next The next version (beta) label Dec 29, 2020
@stale
Copy link

stale bot commented Jan 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jan 30, 2021
@stale stale bot closed this as completed Feb 7, 2021
@jbetancur jbetancur reopened this Feb 15, 2021
@stale stale bot removed the wontfix This will not be worked on label Feb 15, 2021
@stale
Copy link

stale bot commented Mar 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next The next version (beta) wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants