Hi Gautham,
Greeting from Syncfusion.
Query: I want show the grid spinner, but when I use the showSpinner() grid's function, I get an error
By default, we have created the spinner while rendering the grid component but in your code example you are tried to show the spinner in ngAfterViewInit(Spinner element yet not created) so that it cause the reported problem.
If you want to show the custom spinner in grid then refer the below code example and documentation. Once grid rendered you can show and hide the spinner as per your requirement.
<ejs-grid #grid [dataSource]='data' (created)='created($event)' height='400' width='100%'>
. . . . .
</ejs-grid>
|
import { setSpinner } from '@syncfusion/ej2-popups';
setSpinner({ template: '<div class="loader-centerd-screen"><div></div></div>' });
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
created(){
this.grid.showSpinner();
}
|
Regards,
Hariharan