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.

bootstrap table won't refresh if table is busy

See original GitHub issue

In the documentation it states that the table won’t call the provider if the table is manually put in the busy state but it looks like regardless of whether or not it is in the busy state or even if I manually set busy to false to refresh the provider I am unable to force a refresh of the table provider. I am on Windows 10 using Chrome/Firefox.

My use case is this, when the page loads I am fetching some of the options and default values for the user. The provider gets called before I can load these options and makes a request. The options load and I call table.refresh but it always fails as the table is in a busy state. I would like to be able to abandon the previous refresh and tried using a CancellationToken with axios but found that even though I could cancel the call it still didn’t have enough time to set the tables busy state to false. There needs to be a way to refresh the table and cancel/abort any previous request.

Currently I have had to fall back to a non-optimal pattern shown below.

  triggerRefresh() {
            var self = this;

            if (self.$refs.listtable.busy) {
                var handle = window.setInterval(function () {
                    if (!self.$refs.listtable.busy) {
                        window.clearInterval(handle);
                        self.$refs.listtable.refresh();
                    }
                }, 30);
            }
            else {
                self.$refs.listtable.refresh();
            }
    
        }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
runxc1commented, Jan 7, 2019

@tmorehouse is there any way to cancel the previous provider function. If I call refresh 3 time in succession I wouldn’t expect it to wait for the results of the first call before triggering it a second time and so on. Granted some form of debounce would help but if the query is long running I want to abandon it and immediately start the 3rd.

1reaction
tmorehousecommented, Dec 6, 2018

Are you using the .sync modifier to update your copy of the busy prop?

You could also have your provider function return an empty array [] initially and then after your options are set up, then have your provider to the actual fetch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bootstrapTable doesn't refresh with the newly created json
Refresh action is executed (the form blings when its refreshed also no errors in the console). Tried with console.log in the .done() and...
Read more >
Spinners - Bootstrap
Indicate the loading state of a component or page with Bootstrap spinners, built entirely with HTML, CSS, and no JavaScript.
Read more >
data table out of format in vf page - Salesforce Developers
Hi Bob, I am using bootstrap for responsive page. I am getting the desired output except the stacking of columns from horizontal to...
Read more >
Troubleshooting common AWS CDK issues
This topic describes how to troubleshoot the following issues with the AWS CDK.
Read more >
ARIA live regions - Accessibility - MDN Web Docs - Mozilla
Using JavaScript, it is possible to dynamically change parts of a page without requiring the entire page to reload — for instance, to...
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