Having trouble getting help?
Contact Support
Contact Support
Customizing loading indicator in Angular Pivotview component
23 Aug 20253 minutes to read
The pivot table displays a loading indicator during data processing operations such as filtering, sorting, and aggregation calculations. The default loading spinner can be customized to match application design requirements using the spinnerTemplate
property.
The spinnerTemplate
property accepts an HTML string that defines the custom loading indicator appearance. This enables control over the visual presentation, including custom styling and animations.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { PivotViewAllModule, PivotFieldListAllModule } from '@syncfusion/ej2-angular-pivotview'
import { Component, OnInit } from '@angular/core';
import { IDataSet, PivotView } from '@syncfusion/ej2-angular-pivotview';
import { DataManager, WebApiAdaptor, Query, ReturnOption } from '@syncfusion/ej2-data';
import { DataSourceSettingsModel } from '@syncfusion/ej2-pivotview/src/model/datasourcesettings-model';
@Component({
imports: [
PivotViewAllModule,
PivotFieldListAllModule
],
standalone: true,
selector: 'app-container',
template: `<ejs-pivotview #pivotview id='PivotView' height='350' [dataSourceSettings]=dataSourceSettings [width]=width spinnerTemplate="<i class='fa fa-cog fa-spin fa-3x fa-fw'></i>"></ejs-pivotview>`
})
export class AppComponent implements OnInit {
public dataSourceSettings?: DataSourceSettingsModel;
public data?: DataManager;
public width?: string;
ngOnInit(): void {
this.data = new DataManager({
url: 'https://bi.syncfusion.com/northwindservice/api/orders',
adaptor: new WebApiAdaptor,
crossDomain: true
});
this.width = '100%';
this.dataSourceSettings = {
dataSource: this.data,
expandAll: true,
filters: [],
columns: [{ name: 'ProductName', caption: 'Product Name' }],
rows: [{ name: 'ShipCountry', caption: 'Ship Country' }, { name: 'ShipCity', caption: 'Ship City' }],
formatSettings: [{ name: 'UnitPrice', format: 'C0' }],
values: [{ name: 'Quantity' }, { name: 'UnitPrice', caption: 'Unit Price' }]
};
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
Disabling the loading indicator
The loading indicator can be completely disabled by setting the spinnerTemplate
property to an empty string.
export class AppComponent {
public spinnerTemplate: string = '';
}