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

Added jumpToPage option #1398

Merged
merged 9 commits into from
Jul 10, 2020
Merged

Added jumpToPage option #1398

merged 9 commits into from
Jul 10, 2020

Conversation

patorjk
Copy link
Collaborator

@patorjk patorjk commented Jul 9, 2020

This option, if true, adds a "Jump to Page" dropdown to the table footer that allows users to navigate to a specific page.

@coveralls
Copy link

coveralls commented Jul 9, 2020

Coverage Status

Coverage increased (+0.3%) to 71.385% when pulling 1ccfd8f on jumpToPage into 2d6c628 on master.

const textLabel = textLabels.pagination.jumpToPage;

    let pages = [];
let lastPage = Math.min( 1000, getPageValue(count, rowsPerPage, 1000000));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of ServerSide, it seems that we need to find the value in another way.

For example, Add lastPage props, options

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll still work. When using serverSide, you're supposed to have the total count of the table (but you only display the current page of entries). This feature is actually ported over from a fork I was using and I have a bunch of serverSide tables.

Toolbar, 
Typography
} from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method Higher-order component(withStyles) looks better than method Hooks(makeStyles).

Especially in the case of functional component

withStyles to makeStyles

However, it is not an unconditional task.
It has nothing to do with behavior | logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! I first had the component as a class but then decided to make it a hook, however, I must have gotten distracted and forgot the withStyles/makeStyles part. Kind of interesting that everything still worked fine. I'll push an update here shortly though.

@patorjk patorjk changed the base branch from master to v3_2_0 July 10, 2020 20:42
@patorjk patorjk merged commit f0096ca into v3_2_0 Jul 10, 2020
@patorjk patorjk mentioned this pull request Jul 10, 2020
@wdh2100 wdh2100 deleted the jumpToPage branch December 11, 2020 23:38
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.

None yet

3 participants