Posted 17 July 2020, 7:53 am EST
Hello,
I’m trying to export a grid, which usually take around 50-60 secs. When i click the export button, exportGrid() gets triggered.
In this function i’m setting a variable exporting = true, which will show the spinning icon on UI. And after download completes it sets back to false.
Issue : On button click, variable is immediately set to true, but the spinning icon does not appear to be spinning. It take around 40 secs for it to appear and mainly it appears on the screen right before it downloads the file.
How can i get this icon to spin immediately after the button click?
exportGrid(grid) {
this.exporting = true;
wjcGridXls.FlexGridXlsxConverter.saveAsync(grid, {
includeColumnHeaders: true,
sheetName: 'metadata'
}, 'metadata' + '.xlsx', (base64) => { // onSaved
this.exporting = false;
}, (reason) => { // onError
console.log('The reason of save failure is ' + reason);
this.error = reason;
this.exporting = false;
})
}
<div [hidden]="!exporting" class="spinner-load">
<mat-progress-spinner
class="example-margin"
[color]="color"
[mode]="mode"
[diameter]="40">
</mat-progress-spinner>
<span> Downloading ...</span>
</div>
<div [hidden]="exporting" class="loader"></div>