Loading animation in EJ2 JavaScript Gantt control

2 May 20233 minutes to read

The loading indicator is used to display a visual indicator while the Gantt is fetching data or performing certain actions, such as sorting or filtering. The gantt support two indicator types, which is achieved by setting the loadingIndicator.indicatorType property to Shimmer or Spinner. The default value of the indicator type is “Spinner.”

In the following sample, the Shimmer indicator is displayed while the gantt is scrolled when using the virtual data.


var ganttChart = new ej.gantt.Gantt({
        dataSource: virtualData,
		taskFields: {
            id: 'TaskID',
            name: 'TaskName',
            startDate: 'StartDate',
            endDate: 'EndDate',
            duration: 'Duration',
            progress: 'Progress',
            parentID: 'parentID'
        columns: [
            { field: 'TaskID' },
            { field: 'TaskName' },
            { field: 'StartDate' },
            { field: 'Duration' },
            { field: 'Progress' }
        loadingIndicator: { indicatorType: 'Shimmer' },
        enableVirtualization: true,
<!DOCTYPE html><html lang="en"><head>
    <title>EJ2 Gantt</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Typescript Gantt Controls">
    <meta name="author" content="Syncfusion">
    <link href="index.css" rel="stylesheet">
	<link href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet" type="text/css">
    <link href="https://cdn.syncfusion.com/ej2-notifications/material.css" rel="stylesheet" type="text/css">
<script src="https://cdn.syncfusion.com/ej2/23.2.4/dist/ej2.min.js" type="text/javascript"></script>
<script src="es5-datasource.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>

    <div id="container">
        <div id="Gantt"></div>        

var ele = document.getElementById('container');
if(ele) {
  ele.style.visibility = "visible";
<script src="index.js" type="text/javascript"></script>