Enable/Disable button dynamically (based on Job Status)
I have created an Action inside my ListPage Header (headerActions). This action is firing a Batch Job. What I really would like is some way to disable the button (and show a loading indicator icon) during the time this job runs. When it is finished, it should be enabled again.
Not sure how to achieve this. I can of course check if the job runs and prevent users from starting another one, but it would be nice to make it visible.
I tried something with the
Any ideas?
Not sure how to achieve this. I can of course check if the job runs and prevent users from starting another one, but it would be nice to make it visible.
I tried something with the
->disabled(fn () => $this->checkIfJobIsRunning), but how can I make this dynamic?Any ideas?