Skip to main content

Task Properties

On this page you'll find the full list of properties that the task object may include.

The full list of properties of the link object is given in the Link Properties article.

Required properties

These properties will always be defined on the client. Gantt expects the properties to be specified in the task object on data loading but if they are not specified, Gantt will add them by itself. If you remove one of these properties for the loaded tasks, Gantt will start throwing errors.

NameTypeDescription
idstring | numberThe task id, auto-generated if not set
start_dateDateThe date when a task is scheduled to begin. Data Loading If not specified, Gantt will calculate it based on the end_date and duration properties. The property becomes optional when setting unscheduled: true.
end_dateDateThe date when a task is scheduled to be completed. Data Loading If not specified, Gantt will calculate it based on the start_date and duration properties. The property becomes optional when setting unscheduled: true.
durationnumberThe task duration. Data Loading If not specified, Gantt will calculate it based on the start_date and end_date properties.

Optional properties

These properties may or may not be defined. The default logic and templates of gantt will use these properties if they are defined.

NameTypeDescription
auto_schedulingbooleanDefines whether gantt should do auto-scheduling of the task (true or not specified) or not (false)
bar_heightnumberSets the height of the DOM element of the task in the timeline area
baselinesBaseline[]An array with the baselines
calendar_idnumber | stringSets the id of the custom calendar to be assigned to the task. The name of the property depends on the value of the calendar_property option
colorstringSets the color of the task in the timeline area (i.e. sets background-color for the gantt_task_line element of the task)
constraint_dateDateThe date of the task constraint. It is added to the task object when auto-scheduling with time constraints is enabled. The property isn't used if auto_scheduling_compatibility is enabled.
constraint_typestringThe type of the task constraint ("asap", "alap", "snet", "snlt", "fnet", "fnlt", "mso", "mfo"). It is added to the task object when auto-scheduling with time constraints is enabled. The property isn't used if auto_scheduling_compatibility is enabled.
deadlineDateSpecifies the deadline date for the task. A visual indicator is displayed in the timeline when this property is set.
editablebooleanDefines whether the task can be editable in the read-only Gantt chart. The name of the property depends on the value of the editable_property option
group_idstring | numberThe group's id. It is added to the tasks grouped by some criterion if the property used for grouping tasks (relation_property in the groupBy() method) is specified as an object.
hide_barbooleanDefines whether a task (type:"task") or milestone (type:"milestone") should be hidden in the timeline area
keystring | numberThe key of the group. It is added to the tasks grouped by some criterion if the property used for grouping tasks (relation_property in the groupBy() method) is specified as an array. It is also added to the tasks with the name of the group (for example, to the "High", "Normal", "Low" tasks if you've grouped tasks by priority. Check the example).
labelstringThe label of the group. It is added to the tasks with the name of the group (for example, if you've grouped tasks by priority, the property will be added to the tasks with "High", "Normal", "Low" names. Check the example).
openbooleanSpecifies whether the task branch will be opened initially (to show child tasks). To close/open the branch after Gantt initialization, use the related methods: close() and open()
parentnumber | stringThe id of the parent task. If the specified parent doesn't exist, the task won't be rendered in the Gantt. The id of the root task is specified by the root_id config.
progressnumberThe task's progress (from 0 to 1)
progressColorstringThe color of the task progress in the timeline area (i.e. sets background-color for the gantt_task_progress element of the task progress)
readonlybooleanDefines whether the task must be readonly. The name of the property depends on the value of the readonly_property option
renderstringDefines how subtasks of the task must be displayed. Values: "split" | "". If set to "split", the subtasks will be displayed in one row. In addition, if you enable the open_split_tasks property, the subtasks will be rendered in one row only if the task is collapsed.
resourceArray <string>An array with resources assigned to the task. It is added to the task object when importing data from MS Project/Primavera
rollupbooleanSpecifies whether a task (type:"task") or milestone (type:"milestone") should appear on the parent projects.
row_heightnumberSets the height for the task's row
targetstringThe id of the target task. The property displays the same value as the $drop_target property. The property is added to the task object only if Data Processor is enabled, after the task is updated and data is sent to the server.
textanyThe name of the task. If necessary you may use any other name for this property. The property is used in default configurations of different parts of Gantt.
textColorstringThe color of the task's text in the timeline area (i.e. sets color for the gantt_task_line element of the task)
typestringThe task type. The available values are stored in the types object:
  • "task" - a regular task (default value).
  • "project" - a task that starts, when its earliest child task starts, and ends, when its latest child ends. The start_date, end_date, duration properties are ignored for such tasks.
  • "milestone" - a zero-duration task that is used to mark out important dates of the project. The duration, progress, end_date properties are ignored for such tasks.
unscheduledbooleanDefines whether the task must be unscheduled. By default, the unscheduled task isn't displayed in the timeline area, empty values are displayed in the grid instead of the start and end dates.

Dynamic properties

Dynamic properties are created on the client and represent the current state of a task or a link. They shouldn't be saved to the database, gantt will ignore these properties if they are specified in your JSON/XML.

NameTypeDescription
[resource_property]string | Array <any>resource_property The property may have any other name. This property stores the resource id associated with resourceGrid/Timeline/Histogram/Calendar.
$auto_end_dateDateA computed end date of the project task from its subtasks. Added and updated when "auto_scheduling" is disabled.
$auto_start_dateDateA computed start date of the project task from its subtasks. Added and updated when "auto_scheduling" is disabled.
$calculate_durationbooleanA system property that is used in internal calculations.
$custom_dataobjectAn object which contains custom properties of a task which were defined in the importFromMSProject() and importFromPrimaveraP6() methods
$dataprocessor_classstringA system property which defines whether the task has been updated. It is added to the task object when Data Processor is enabled. If the value of the property is "updated", the task's text will be bold in the grid but it is possible to define your own styles via CSS.
$drop_targetstringThe id of the target task. A temporary property which is added to the task object when dragging the task vertically.
$effective_calendarstringThe id of the calendar (or resource calendar) assigned to the task. A system property that is used in internal calculations.
$expanded_branchbooleanA system property which shows whether the task is visible depending on whether the task's parents are expanded or not. If at least one parent is collapsed, the task won't be visible. The exception is only split tasks (subtasks).
$has_childbooleanDefines whether the Gantt should send a request to the server to load the first-level subtasks of the task. The property is used when the branch_loading property is enabled. The name of the property depends on the value of the branch_loading_property option.
$indexnumberThe global vertical position of the task. It is bound to the task and changes if the tasks below or above are open or closed. If the parent of the task is collapsed, the property doesn't show the actual position of the task.
$levelnumberThe task's level in the tasks hierarchy (zero-based numbering)
$local_indexnumberThe vertical position of the task in the branch (under the parent). It isn't bound to the task and doesn't change if the tasks below or above are open or closed as inside the branch as globally. If the parent of the task is collapsed, the property doesn't show the actual position of the task.
$newbooleanIt is added for a new task when it is created via the createTask method or via the "+" button. The property is added to the task object when you open the lightbox, and is removed after you save the task.
$no_endbooleanRequired, a system property which is added to the task object. True if the end_date property couldn't be calculated (when the start_date property is loaded but there is no duration or end_date one). In this case, you cannot move or resize the task. The end_date property will depend on the end_date of the subtasks (if any). The start_date property will be fixed and won't change. Auto-scheduling won't work for such a task. If the $no_start property is enabled, the task will fully depend on the dates of its subtasks or on the date of the first task.
$no_startbooleanRequired, a system property which is added to the task object. True if the start_date property couldn't be calculated (when the end_date property is loaded but there is no duration or start_date one). The start_date property will depend on the start_date of the subtasks (if any) or on the start date of the first task. The end_date property will be fixed and will change only if the start date of the subtasks/first task is bigger than the end date of the task. Auto-scheduling won't work for such a task. If the $no_end property is enabled, the task will fully depend on the dates of its subtasks or on the date of the first task.
$openbooleanA system property which specifies whether the task is currently opened (true). If you change the value of the property and re-draw the Gantt, it will open or close the task. To change the state of the task, you may also apply the open or close methods.
$rawobjectAn object with original names of task properties which were imported from MS Project / Primavera into the export module (export server). The properties appear in the $raw object while the file is converted into JSON-format but before they are converted into names and format expected by Gantt.
$rendered_atstring | numberThe id of a row the rollup item / split task is rendered at. This is the temporary property which appears in the object of the rollup/split task only when it's been rendering on the page.
$rendered_parentnumber | stringThe id of the parent under which the task is rendered (not id of the real parent of the task). The property is used in internal calculations and on tasks' grouping.
$rendered_typestringThe type of the rendered task (a temporary property).
$resourceAssignmentsArray <any>An array with ids of resources assigned to the task (a temporary property). But the most actual data is stored in the store of resource assignments not in this property.
$rollupArray <string | number>An array with ids of tasks and milestones which have appeared on the current task
$sourceArray <string | number>Required, an array with ids of all links that come out of the task
$split_subtaskbooleanAppears if the task is a subtask of a split task (i.e. arranges in one row with other subtasks)
$targetArray <string | number>Required, an array with ids of links that come into task
$transparentbooleanA temporary property which is added to the task object when dragging the task vertically. The task looks a little bit transparent in grid on vertical dragging due to this property.
$virtualbooleanIt is added to the tasks grouped by some criterion. After the grouping is reset, tasks with $virtual: true are removed
$wbsstringThe WBS code of the task (a temporary property). It is added to the task object after applying the getWBSCode method. If the value of the code has changed (the task's parent or position has been changed), you need to call the getWBSCode method again to get the updated value of the code.

Example

const data = {
tasks: [
{ id: 1, text: "Project #1", start_date: "01-04-2025", duration: 18 },
{ id: 2, text: "Task #1", start_date: "02-04-2025", duration: 8, parent: 1 },
{ id: 3, text: "Task #2", start_date: "11-04-2025", duration: 8, parent: 1 }
],
links: []
};