How to change the button title and turn it disabled while the calculations are running and dcc.loading spinner running?

Hey guys,

I’m creating a solution where I would like to click on the “generate report” button and it will trigger my callback;

On this callback, I will load and calculate the information to be displayed on the “content-output”;

While the load and calculations are made, I would like to display a different title on my button “generating report” and set the button as disabled=True until the calculation finishes; Once the calc is done, it will become back to “generate report” and also disabled=False;

I added an example… While the spinner is running, the “generate report” btn should have a different behavior

I do not find any reference about this, but I did some tests without success;

Someone has done something like this or similar, or even know any reference that could help me on it?

Thank you very much in advance;

Hi @kabure

This is available in Dash Labs - see more info here: 📣 Dash Labs 0.4.0: @long_callback caching and Windows support

Heey Ann, always you!!! hehehe Thank you very much;

it’s very cool… I just need to understand how to work with it hehehe

The new Dash intends to complement or to substitute de “original” Dash? Do you know the answer to this question?


Haha - me again :sweat_smile:

Dash Labs is the library used to explore new features in Dash. I expect (hope?) that most of these enhancements will be part of Dash 2.0 which is due to be released in a few months.

My understanding is that there may be some breaking changes in Dash 2.0, (given the semantic versioning) but the new features will complement the “original” Dash

1 Like

Hey @AnnMarieW, thank you very much for your explanations;

I played with these new components and I did understand how to reproduce the exact behavior I need, but once I tried to add more the other inputs I have to the callback it seems like it doesn’t allow more than one input;

Do you have some experience working with the @app.long_callback component?