-
Notifications
You must be signed in to change notification settings - Fork 782
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
Dual callbacks on pagePerSize dropdown change #1587
Comments
Also I found a serve mismatch as when changing page size from dropdown, |
Because sizePerPage change may also change the page due to the number of total page will be recalculate after sizePerPage changed, for example, if you are in last page(10) with sizePerPage 10, if you change sizePerPage to 80, now, the page 10 is not existing. so But it's a chance problems, I can avoid to call Thanks !! |
I've currently used the same fix.
Yes, that's what I require. But I'm unsure what's the correct way. |
I think I can avoid call And also I'll investigate if we can call the Feel free to let me know if you have any idea or concern, thanks 👍 |
Sure @AllenFang. Thanks for taking quick action. const onPageChange = () => {
// If previous page size and the new page size are equal, page change is actual, otherwise it is triggred by sizePerPage dropdown change
// This is a fix. An issue in the original repo has been created here: https://github.com/AllenFang/react-bootstrap-table/issues/1587
let oldPageSize = this.refs['BootstrapTable'].getSizePerPage(),
isActualPageChange = oldPageSize == sizePerPage
if (isActualPageChange) {
// onPageChange code
}
} |
Nice, thanks for sharing 👍 |
Hey @AllenFang any updates on this. |
Hello @AllenFang
For some weird reason I'm doing a fetch request on
onPageChange
andsizePerPageListChange
both.I've encountered a scenario where
sizePerPageListChange
event also triggersonPageChange
event. This is very similar to the example here(section: Pagination Hook)Can we avoid the table doing multiple events like these?
Thanks.
The text was updated successfully, but these errors were encountered: