question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dual callbacks on pagePerSize dropdown change

See original GitHub issue

Hello @AllenFang

For some weird reason I’m doing a fetch request on onPageChange and sizePerPageListChange both.

I’ve encountered a scenario where sizePerPageListChange event also triggers onPageChange event. This is very similar to the example here(section: Pagination Hook)

Can we avoid the table doing multiple events like these?

Thanks.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
prajapati-parthcommented, Sep 5, 2017

Sure @AllenFang. Thanks for taking quick action. Here’s the code snippet how I fixed it. If it can be of some help to you.

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
    }
}
0reactions
minkeshcommented, Sep 20, 2018

Hey @AllenFang any updates on this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamically updating dropdown options with 2 Inputs in ...
Try to remove the Input('batch_dd','search_value') from the batch_options callback (not used). It could be that updating 'batch_dd' options ...
Read more >
You can split the screen to view your map and planner together.
Select schedule slot and press Enter or double click to change information. n How to move schedule. 1. Drag and drop schedule to...
Read more >
Chained Callback in Dash - YouTube
Learn to connect between Drodpdowns when building interactive dashboard apps. In this tutorial I'll show you how to use the Chained Callback ......
Read more >
A Compacting Real-Time Memory Management System
space and it increases with the increase of fragmentation. ... Sequential fit allocators are based on a single or double linked list.
Read more >
Control drop-down list appearance and behavior - MATLAB
Drop-down lists are UI components that enable the user to select an option or type in text. ... ValueChangedFcn — Value changed callback...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found