-
Notifications
You must be signed in to change notification settings - Fork 932
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
Added jumpToPage option #1398
Conversation
const textLabel = textLabels.pagination.jumpToPage; | ||
|
||
let pages = []; | ||
let lastPage = Math.min( 1000, getPageValue(count, rowsPerPage, 1000000)); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
src/components/JumpToPage.js
Outdated
Toolbar, | ||
Typography | ||
} from '@material-ui/core'; | ||
import { withStyles } from '@material-ui/core/styles'; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This option, if true, adds a "Jump to Page" dropdown to the table footer that allows users to navigate to a specific page.