Gantt Control for JavaScript


The Essential JavaScript Gantt control has been designed to visualize and edit a project schedule and track project progress. It helps to organize and schedule projects, and also update project schedules by editing, dragging, and resizing them.

Key Features

·      Sorting
·      Editing
·      Task Relationships
·      Striplines
·      Baseline
·      Localization
·      Resource Display

Getting Started

The following steps illustrate how to create the Gantt control for JavaScript.

Gantt Creation

1.     Create an HTML file and add the following template to the HTML file.

<title>Getting Started with Gantt Control for JavaScript</title>
<!-- Style sheet for default theme(flat azure). -->
<link href=" " rel="stylesheet" />
<script src=""></script>
script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>

2.   Add a Div element within the Body element of the HTML file as follows. 


3.   Create a data source for the Gantt control. 



4.   Finally, initialize the Gantt control with the data source created in the previous step. 


A Gantt chart is created as shown in the following screen shot.

Concepts and Features


You can turn on Sorting during Gantt initialization by using the following code example. 

allowSorting: true,


The following code example illustrates how to turn on editing in Gantt control. 

allowEditing: true,
allowAdding: true,
allowDeleting: true,
editMode: "cellEditing"


You can show or hide the toolbar in Gantt by using the following code example. 

allowToolBar: true,
toolBarItems: [ej.Gantt.toolBarItems.Add,

Wiring Events

Events are important for providing notifications on changes and actions that have taken place in the control. The following code example illustrates event initialization in a Gantt control. 

$("#GanttContainer").ejGantt("model.eventName", );

You must bind the event’s “eventName” to the Gantt control as follows. 

dataSource: data,
allowColumnResize: true,                       

taskIdMapping: "TaskID",
taskNameMapping: "TaskName",
scheduleStartDate: "02/23/2014",
scheduleEndDate: "03/30/2014",
startDateMapping: "StartDate",                    

progressMapping: "Progress",
durationMapping: "Duration",
childMapping: "Children",                      

highlightWeekEnds: true,
rowSelected: function (args)
// Event handler.

Please send us your feedback to Your thoughts and opinions are important to us.

Content Contributor: Rajasekar G Content Editor: GeeGee Inekeya

Share this post:

Leave a comment