This is a migrated thread and some comments may be shown as answers.

Loading indicator during local computation

2 Answers 367 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kristiyan
Top achievements
Rank 1
Kristiyan asked on 31 May 2019, 11:26 AM

Hello Telerik team,

I would like to use the built-in loading indicator, but it doesn't get shown during (relatively heavy) local computations (nodejs loop freezes). Do you have any suggestion? Thanks in advance!

Best regards,

K. Dimitrov

2 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 03 Jun 2019, 12:44 PM
Hello Kristiyan,

When there are time-consuming synchronous operations that are blocking the main thread, the suggested approach is to make them asynchronous (for example via calling the time-consuming operation in a setTimeout).

This way a loading indicator can be displayed before starting the time-consuming operation, and hidden synchronously after the operation is complete (in the body of the setTimeout callback, right after calling the time-consuming operation).

Here is a runnable sample demonstrating the suggested approach:

https://stackblitz.com/edit/angular-3viu72?file=app/app.component.ts

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Kristiyan
Top achievements
Rank 1
answered on 04 Jun 2019, 08:19 AM

Hello Dimiter and thanks for your suggestion. I have also been considering this solution, but maybe I didn't quite get it working. Thanks for the working example!

Cheers, Kristiyan

Tags
Grid
Asked by
Kristiyan
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Kristiyan
Top achievements
Rank 1
Share this question
or