Remove imageUrl from button

1 Answer 36 Views
Button
Roy
Top achievements
Rank 1
Iron
Roy asked on 09 Oct 2023, 01:44 PM

Use case: I have a button that triggers a long-running process.  I would like to add a spinning icon to the button itself to show that the process is already in progress (it has no reason to affect the rest of the page).  

 

I can add an imageUrl on the fly, however when the process completes, I would like to be able to remove the image, and it does not seem to work.  If I set imageUrl to null or empty string, nothing happens. 

This is not a huge problem as I can write jQuery code to hide the image, I just wondered if there was a simpler way.  

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 12 Oct 2023, 07:12 AM

Hello, Roy,

Could you please take a look at our Integration Loader demo, which shows how the Kendo Loader can be used within a button? It seems it will work nicely in your scenario.

Looking forward to your reply.

Regards,
Martin
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Roy
Top achievements
Rank 1
Iron
commented on 12 Oct 2023, 03:38 PM

Thank you! Yes, that will work fine.

 

The scenario I want it for is excel export of a grid where we are including all records, meaning a fairly long server request.  I can show the loader when the user first clicks the button, but in order to hide the loader, I've been using the RequestEnd event of the grid.  That works fine but it occurred to me that if the user refreshed the grid, RequestEnd would get fired and hide the loader. 

Any way I can tell the RequestEnd triggered by the Excel Export apart from one triggered by a normal grid search?  Or any better way I can hide the loader when the excel export is done?

Martin
Telerik team
commented on 17 Oct 2023, 01:12 PM

Hello, Roy,

The only distinguisher I can spot in the requestEnd event is that the event object coming from the Read end point contains a response and is missing in the object when the Grid is exported. Would that be enough, mabe check if e.response === undefined?

Looking forward to your reply.

Tags
Button
Asked by
Roy
Top achievements
Rank 1
Iron
Answers by
Martin
Telerik team
Share this question
or