- Home
- Forum
- Angular - EJ 2
- Wrong loading animation is shown
Wrong loading animation is shown
Hi, I want to show the shimmer loading animation, while my data is loading.
Because I want to handle fetching the data myself, I use the showSpinner and hideSpinner functions.
But when I use these, the circle is shown although I pass the "Shimmer" indicatorType:
Hi Niels,
Greetings from Syncfusion.
For your query, we would like to inform you that by default, shimmer effect is occurred for every scroll action and data loading. So, no need to give indicator type. For programatically, you want to show and hide the shimmer effect, we suggest you use the showMaskRow and hideMaskRow methos respectively. Refer code snippet and sample for your reference.
Code-Snippet:
app.component.ts:- export class AppComponent { public projectEndDate: Date; public ngOnInit(): void { this.data = virtualData; } onButtonClick() { var ganttInstance = (document.getElementById('SplitTasks') as any) .ej2_instances[0]; ganttInstance.showMaskRow(); } onButtonClick1() { var ganttInstance = (document.getElementById('SplitTasks') as any) .ej2_instances[0]; ganttInstance.hideMaskRow(); } } |
Sample - Nxgnzj (forked) - StackBlitz
Regards,
Sridharan
I am using the created and dataBound events to show and hide maskRow, but nothing is shown
Hi Niels,
We suspect that the theme references may not be properly updated in your project, which is causing the shimmer effect to not display on initial load and scroll. Please find the updated style references below:
OR
|
// index.html <link rel='nofollow' href=https://cdn.syncfusion.com/ej2-notifications/27.1.58/material.css rel="stylesheet" type="text/css" /> |
Note: The above styles are dependencies for the Gantt chart.
When the shimmer effect is enabled, it will appear during the initial load and
while scrolling.
We
previously suggested using the showMaskRow and hideMaskRow methods in the
created and dataBound events to render the shimmer effect in your project.
For more information, you may refer to the following link:
https://ej2.syncfusion.com/angular/documentation/gantt/getting-started
If still issue faced share the sample for our validation after we will share
the validation details with proper solution.
Regards,
Ajithkumar G
Hi, I am using the material3 style sheets. Is there a problem there?
Niels,
No, there’s no issue with the Material3 theme. Refer the attached sample below for your reference which we used material3 theme.
Sample - Nxgnzj (forked) - StackBlitz
Try to incorporate the suggested themes files in our previous update in import statement to resolve issue.
Let us know if you need further assistance.
Regards,
Sridharan
I have found the problem. I cannot call maskRow() and pass a loadingIndicator object at the same time
Niels,
For your query, we would like to inform you that it is not necessary to use both loadingIndicator and showMaskRow methods simultaneously. You only need to use the showMaskRow and hideMaskRow methods, as the shimmer effect will appear by default during scrolling actions and initial load when virtualization is enabled. Please refer to the code snippet and sample for more information.
Code-Snippet:
app.component.ts:- export class AppComponent { public ngOnInit(): void { this.data = virtualData; this.taskSettings = { id: 'TaskID', name: 'TaskName', startDate: 'StartDate', endDate: 'EndDate', duration: 'Duration', progress: 'Progress', parentID: 'parentID', }; ...................... } created() { var ganttInstance = (document.getElementById('SplitTasks') as any) .ej2_instances[0]; ganttInstance.showMaskRow(); } dataBound() { var ganttInstance = (document.getElementById('SplitTasks') as any) .ej2_instances[0]; ganttInstance.hideMaskRow(); } } app.component.html:- <ejs-gantt id="SplitTasks" #splittasks height="450px" [dataSource]="data" [taskFields]="taskSettings" [treeColumnIndex]="1" [splitterSettings]="splitterSettings" [columns]="columns" [labelSettings]="labelSettings" [projectStartDate]="projectStartDate" [projectEndDate]="projectEndDate" [allowSelection]="true" [enableVirtualization]="true" [highlightWeekends]="true" [enableTimelineVirtualization]="true" (created)="created($event)" (dataBound)="dataBound($event)" > </ejs-gantt> |
Sample - Nxgnzj (forked) - StackBlitz
Let us know if you need further assistance.
Regards,
Sridharan
- 7 Replies
- 3 Participants
- Marked answer
-
NV Niels Van Goethem
- Oct 31, 2024 10:20 AM UTC
- Nov 7, 2024 10:10 AM UTC