Spinner or Loader

How can I implement a spinner inside a button like the spinner in Bootstrap 4?

The idea is, that I should show a loader or a spinner when I trigger an event (this could be loading data). Then, after loading the data should hide the spinner. Tried checking the documentation for spinner in dotvvm seems to be not helpful.

We have a video tutorial on how to implement the feature: https://www.youtube.com/watch?v=EeHSMaIEUWA

Source doe is here: https://github.com/riganti/dotvvm-minutes/tree/master/04_LoadingPostBackHandler/DotvvmMinutes.LoadingAnimation

Thank you. May I know if I can implement it in a combobox?

sample scenario is, on combobox change, I load some data. I want to disable to save button after loading all the data. Is it possible? thanks!

In such case Iā€™d recommend adding a property called ButtonSelector in the LoadingAnimationPostBackHandler and in the JavaScript instead of applying the CSS classes on args.sender, apply them on document.querySelector(options.buttonSelector).
You would need to apply the postback handler to the ComboBox also.

Alternatively, we have a control called UploadProgress. It cannot add animation to the button, but it can render the spinner next to the button.

Also, the third option would be to use {value: _page.IsPostBackRunning} to add a conditional CSS class when any postback is running. Something like this:

<dot:Button class-loading={value: _page.IsPostBackRunning} ... />