Search results

Immutable Mode in JavaScript (ES5) Gantt control

23 Mar 2023 / 1 minute to read

The immutable mode optimizes the Gantt re-rendering performance by using the object reference and deep compare concept. When performing the Gantt actions, it will only re-render the modified or newly added rows and prevent the re-rendering of the unchanged rows.

To enable this feature, you have to set the enableImmutableMode property as true.

This feature uses the primary key value for data comparison. So, you need to provide the isPrimaryKey column.

Copied to clipboard

var ganttChart = new ej.gantt.Gantt({
    dataSource: GanttData,
    height: '450px',
    enableImmutableMode: true,
    taskFields: {
        id: 'TaskID',
        name: 'TaskName',
        startDate: 'StartDate',
        duration: 'Duration',
        progress: 'Progress',
        child: 'subtasks'
    toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel','Indent','Outdent'],
    editSettings: {
      allowAdding: true,
      allowEditing: true,
      allowDeleting: true,
      allowTaskbarEditing: true,
      showDeleteConfirmDialog: true
Copied to clipboard
<!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="" rel="stylesheet" type="text/css">
	.e-gantt .e-gantt-chart .e-custom-holiday {
<script src="" type="text/javascript"></script>
<script src="es5-datasource.js" type="text/javascript"></script>

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

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


The following features are not supported in the immutable mode:

  • Column reorder
  • Virtualization