Vue Gantt Props

An object that defines the Gantt UI component's configuration properties.

accessKey

Specifies the shortcut key that sets focus on the UI component.

Selector: access-key
Type:

String

| undefined
Default Value: undefined

The value of this property will be passed to the accesskey attribute of the HTML element that underlies the UI component.

activeStateEnabled

Specifies whether the UI component changes its visual state as a result of user interaction.

Selector: active-state-enabled
Type:

Boolean

Default Value: false

The UI component switches to the active state when users press down the primary mouse button. When this property is set to true, the CSS rules for the active state apply. You can change these rules to customize the component.

Use this property when you display the component on a platform whose guidelines include the active state change for UI components.

allowSelection

Specifies whether users can select tasks in the Gantt.

Selector: allow-selection
Type:

Boolean

Default Value: true

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt
  • allowSelection={false} >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;
See Also

columns[]

An array of columns in the Gantt.

Selector: DxColumn
Default Value: undefined

The columns property accepts an array of columns. To configure a column, use a dxGanttColumn object or specify a data source field (as a string value) to which the column is bound.

NOTE
The Gantt UI component does not support column templates.

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt
  • <Column dataField="title" caption="Subject" width={300} />
  • <Column dataField="start" caption="Start Date" />
  • <Column dataField="end" caption="End Date" />
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

contextMenu

Configures the context menu settings.

Selector: DxContextMenu

dependencies

Configures dependencies.

Selector: DxDependencies
Type:

Object

Default Value: null

View Demo

Dependencies specify the relationships between tasks. The following image illustrates how the Gantt displays dependencies in the chart:

DevExtreme Gantt Chart - Dependencies

The Gantt UI component supports the following dependency types:

  • Finish to Start (FS) - The predecessor task's endpoint specifies the successor task's start point.

  • Start to Start (SS) - The predecessor task's start point specifies the successor task's start point.

  • Finish to Finish (FF) - The predecessor task's end point specifies the successor task's end point.

  • Start to Finish (SF) - The predecessor task's start point specifies the successor task's end point.

In a database, you can use any of the following formats (digit or string) to store dependency types:

Dependency Type Supported Values
Finish to Start (FS) 0, "0", "FS", "fs"
Start to Start (SS) 1, "1", "SS", "ss"
Finish to Finish (FF) 2, "2", "FF", "ff"
Start to Finish (SF) 3, "3", "SF", "sf"

Use the dataSource property to bind the UI component to a data source, which contains information about dependency types. If the field names in your data source differ from the 'id', 'type', 'predecessorId' and 'successorId' default names, use the keyExpr, typeExpr properties to map data fields.

See Also
App.js
data.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • Dependencies,
  • // ...
  • } from 'devextreme-react/gantt';
  • import {
  • dependencies,
  • // ...
  • } from './data.js';
  •  
  • const App = () => {
  • return (
  • <Gantt ... >
  • <Dependencies
  • dataSource={dependencies}
  • keyExpr="dependencyId"
  • typeExpr="dependencyType"
  • predecessorIdExpr="taskPredecessorId"
  • successorIdExpr="taskSuccessorId" />
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;
  • export const dependencies = [{
  • 'dependencyId': 0,
  • 'taskPredecessorId': 1,
  • 'taskSuccessorId': 2,
  • 'dependencyType': 0
  • },
  • // ...
  • ];

disabled

Specifies whether the UI component responds to user interaction.

Type:

Boolean

Default Value: false

editing

Configures edit properties.

Selector: DxEditing
Type:

Object

The UI component allows users to add, modify and delete tasks, resources and dependencies. Set the enabled property to true to enable edit functionality.

NOTE
Make sure that your data sources (tasks, resources and dependencies) support edit actions.

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • Editing,
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt ... >
  • <Editing
  • enabled={true}
  • allowDependencyAdding={false}
  • allowDependencyDeleting={false}
  • allowResourceAdding={false}
  • allowResourceDeleting={false}
  • allowTaskAdding={false}
  • allowTaskDeleting={false}
  • allowTaskResourceUpdating={false}
  • allowTaskUpdating={false} />
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;
See Also

elementAttr

Specifies the global attributes to be attached to the UI component's container element.

Selector: DxElementAttr
Type:

Object

Default Value: {}

App.js
  • import React from 'react';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • ganttAttributes = {
  • id: 'elementId',
  • class: 'class-name'
  • }
  •  
  • render() {
  • return (
  • <Gantt ...
  • elementAttr={this.ganttAttributes}>
  • </Gantt>
  • );
  • }
  • }
  • export default App;

endDateRange

Specifies the end date of the date interval in the Gantt chart.

Selector: end-date-range
Type:

Date

Default Value: null

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • const startDateRange = new Date(2018, 1, 1);
  • const endDateRange = new Date(2020, 1, 1);
  •  
  • return (
  • <Gantt
  • startDateRange = {startDateRange}
  • endDateRange = {endDateRange} >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;
See Also

filterRow

Configures filter row settings.

Selector: DxFilterRow

View Demo

Users can enter a value into the filter row to filter Gantt data. Set the filterRow.visible property to true to display the filter row.

DevExtreme Gantt - Filter Row

Each cell in the filter row contains a magnifier icon. Click a column's magnifier icon to select a filter operation available for the column. Use the selectedFilterOperation property to specify the default filter operation for a column's filter row.

DevExtreme Gantt - Filter Row

To hide a filter row cell for an individual column, set the column’s allowFiltering property to false.

firstDayOfWeek

Specifies the first day of a week.

Selector: first-day-of-week
Type:

FirstDayOfWeek

| undefined
Default Value: undefined

The property's value can be from 0 to 6.

  • 0 - Sunday
  • 1 - Monday
  • 2 - Tuesday
  • 3 - Wednesday
  • 4 - Thursday
  • 5 - Friday
  • 6 - Saturday

The culture settings specify the property's default value.

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt
  • firstDayOfWeek={1} >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

focusStateEnabled

Specifies whether the UI component can be focused using keyboard navigation.

Selector: focus-state-enabled
Type:

Boolean

Default Value: false

headerFilter

Configures the header filter settings.

Selector: DxHeaderFilter

View Demo

The header filter allows users to filter values in an individual column. The header filter is a popup window that contains all unique values of a column. A click on the filter icon invokes the header filter.

DevExtreme Gantt - Header Filter

Set the headerFilter.visible property to true to display filter icons for all columns. To hide the filter icon for an individual column, set the column’s allowHeaderFiltering property to false.

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • HeaderFilter,
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt ... >
  • <HeaderFilter
  • visible={true}
  • width={280}
  • height={350}
  • searchTimeout={800} />
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;
See Also

height

Specifies the UI component's height.

Type:

Number

|

String

|

Function

| undefined
Return Value:

Number

|

String

The UI component's height.

Default Value: undefined

This property accepts a value of one of the following types:

  • Number
    The height in pixels.

  • String
    A CSS-accepted measurement of height. For example, "55px", "20vh", "80%", "inherit".

  • Function (deprecated since v21.2)
    Refer to the W0017 warning description for information on how you can migrate to viewport units.

hint

Specifies text for a hint that appears when a user pauses on the UI component.

Type:

String

| undefined
Default Value: undefined

hoverStateEnabled

Specifies whether the UI component changes its state when a user pauses on it.

Selector: hover-state-enabled
Type:

Boolean

Default Value: false

onContentReady

A function that is executed when the UI component is rendered and each time the component is repainted.

Selector: @content-ready
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Gantt

The UI component's instance.

Default Value: null

onContextMenuPreparing

A function that is executed before the context menu is rendered.

Selector: @context-menu-preparing
Type:

Function

Function parameters:

Information about the event that caused the function's execution.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel showing the context menu.

component

Gantt

The UI component's instance.

data any

Data of the right-clicked task or dependency.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

items

Array<Object>

Items to be displayed in the context menu.

targetKey any

The key of the right-clicked task or dependency.

targetType

String

The type of right-clicked task or dependency.

Default Value: null

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onContextMenuPreparing={this.onContextMenuPreparing}
  • />
  • );
  • }
  • onContextMenuPreparing = (e) => {
  • // your code
  • e.cancel = true;
  • }
  • }
  • export default App;

View Demo

See Also

onCustomCommand

A function that is executed after a custom command item was clicked. Allows you to implement a custom command's functionality.

Selector: @custom-command
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component instance's name.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

name

String

The name of the clicked item.

Default Value: null

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onCustomCommand={this.onCustomCommand}
  • />
  • );
  • }
  • onCustomCommand = (e) => {
  • // your code
  • }
  • }
  • export default App;
See Also

onDependencyDeleted

A function that is executed when a dependency is deleted.

Selector: @dependency-deleted
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the deleted dependency.

values any

The values of the deleted dependency.

Default Value: null

DevExtreme Gantt - Dependency

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onDependencyDeleted={this.onDependencyDeleted}
  • />
  • );
  • }
  • onDependencyDeleted = (e) => {
  • if (e.key != 1)
  • // your code
  • }
  • }
  • export default App;
See Also

onDependencyDeleting

A function that is executed before a dependency is deleted.

Selector: @dependency-deleting
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the dependency's deletion.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the deleted dependency.

values any

The values of the deleted dependency.

Default Value: null

DevExtreme Gantt - Dependency

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onDependencyDeleting={this.onDependencyDeleting}
  • />
  • );
  • }
  • onDependencyDeleting = (e) => {
  • if (e.key != 1) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onDependencyInserted

A function that is executed when a dependency is inserted.

Selector: @dependency-inserted
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the inserted dependency.

values any

The values of the inserted dependency.

Default Value: null

DevExtreme Gantt - Dependency

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onDependencyInserted={this.onDependencyInserted}
  • />
  • );
  • }
  • onDependencyInserted = (e) => {
  • if (e.values.type == 3) {
  • // your code
  • }
  • }
  • }
  • export default App;
See Also

onDependencyInserting

A function that is executed before a dependency is inserted.

Selector: @dependency-inserting
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the dependency's insertion.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

values any

The values of the inserted dependency.

Default Value: null

DevExtreme Gantt - Dependency

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onDependencyInserting={this.onDependencyInserting}
  • />
  • );
  • }
  • onDependencyInserting = (e) => {
  • if (e.values.type == 3) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onDisposing

A function that is executed before the UI component is disposed of.

Selector: @disposing
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Gantt

The UI component's instance.

Default Value: null

onInitialized

A function used in JavaScript frameworks to save the UI component instance.

Selector: @initialized
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Gantt

The UI component's instance.

Default Value: null

App.js
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • constructor(props) {
  • super(props);
  •  
  • this.saveInstance = this.saveInstance.bind(this);
  • }
  •  
  • saveInstance(e) {
  • this.ganttInstance = e.component;
  • }
  •  
  • render() {
  • return (
  • <div>
  • <Gantt onInitialized={this.saveInstance} />
  • </div>
  • );
  • }
  • }
See Also
  • Get a UI component Instance in React

onOptionChanged

A function that is executed after a UI component property is changed.

Selector: @option-changed
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
value any

The modified property's new value.

previousValue any

The UI component's previous value.

name

String

The modified property if it belongs to the first level. Otherwise, the first-level property it is nested into.

fullName

String

The path to the modified property that includes all parent properties.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Gantt

The UI component's instance.

Default Value: null

The following example shows how to subscribe to component property changes:

App.js
  • import React from 'react';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • const handlePropertyChange = (e) => {
  • if(e.name === "changedProperty") {
  • // handle the property change here
  • }
  • }
  •  
  • export default function App() {
  • return (
  • <Gantt ...
  • onOptionChanged={handlePropertyChange}
  • />
  • );
  • }

onResourceAssigned

A function that is executed when a resource is assigned to a task.

Selector: @resource-assigned
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the inserted resource assignment.

values any

The values of the processed resource and task.

Default Value: null

DevExtreme Gantt Chart - Resources

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onResourceAssigned={this.onResourceAssigned}
  • />
  • );
  • }
  • onResourceAssigned = (e) => {
  • if (e.values.taskID != 0) {
  • // your code
  • }
  • }
  • }
  • export default App;
See Also

onResourceAssigning

A function that is executed before a resource is assigned to a task.

Selector: @resource-assigning
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the resource assignment.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

values any

The values of the processed resource and task.

Default Value: null

DevExtreme Gantt Chart - Resources

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onResourceAssigning={this.onResourceAssigning}
  • />
  • );
  • }
  • onResourceAssigning = (e) => {
  • if (e.values.taskID != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onResourceDeleted

A function that is executed when a resource is deleted.

Selector: @resource-deleted
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the deleted resource.

values any

The values of the deleted resource.

Default Value: null

DevExtreme Gantt Chart - Resources

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onResourceDeleted={this.onResourceDeleted}
  • />
  • );
  • }
  • onResourceDeleted = (e) => {
  • if (e.key == 0) {
  • // your code
  • }
  • }
  • }
  • export default App;
See Also

onResourceDeleting

A function that is executed before a resource is deleted.

Selector: @resource-deleting
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the resource deletion.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the deleted resource.

values any

The values of the deleted resource.

Default Value: null

DevExtreme Gantt Chart - Resources

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onResourceDeleting={this.onResourceDeleting}
  • />
  • );
  • }
  • onResourceDeleting = (e) => {
  • if (e.key == 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onResourceInserted

A function that is executed when a resource is inserted.

Selector: @resource-inserted
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the inserted resource.

values any

The values of the inserted resource.

Default Value: null

DevExtreme Gantt Chart - Resources

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onResourceInserted={this.onResourceInserted}
  • />
  • );
  • }
  • onResourceInserted = (e) => {
  • if (e.values.text == " "){
  • // your code
  • }
  • }
  • }
  • export default App;
See Also

onResourceInserting

A function that is executed before a resource is inserted.

Selector: @resource-inserting
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the resource insertion.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

values any

The values of the inserted resource.

Default Value: null

DevExtreme Gantt Chart - Resources

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onResourceInserting={this.onResourceInserting}
  • />
  • );
  • }
  • onResourceInserting = (e) => {
  • if (e.values.text == " "){
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onResourceManagerDialogShowing

A function that is executed before the Resource Manager dialog is shown.

Selector: @resource-manager-dialog-showing
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the Resource Manager dialog showing.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

values

Array<any>

The resources.

Default Value: null

DevExtreme Gantt - Invoke Resource Manager

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onResourceManagerDialogShowing={this.onResourceManagerDialogShowing}
  • />
  • );
  • }
  • onResourceManagerDialogShowing: function (e) {
  • if (e.values[0].key != 1) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onResourceUnassigned

A function that is executed when a resource is unassigned from a task.

Selector: @resource-unassigned
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the deleted resource assignment.

values any

The values of the processed resource and task.

Default Value: null

DevExtreme Gantt Chart - Resources

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onResourceUnassigned={this.onResourceUnassigned}
  • />
  • );
  • }
  • onResourceUnassigned = (e) => {
  • if (e.key != 0) {
  • // your code
  • }
  • }
  • }
  • export default App;
See Also

onResourceUnassigning

A function that is executed before a resource is unassigned from a task.

Selector: @resource-unassigning
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the resource unassignment.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the resource.

values any

The values of the processed resource and task.

Default Value: null

DevExtreme Gantt Chart - Resources

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onResourceUnassigning={this.onResourceUnassigning}
  • />
  • );
  • }
  • onResourceUnassigning = (e) => {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onScaleCellPrepared

A function that is executed before a scale cell is prepared.

Selector: @scale-cell-prepared
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

scaleElement

HTMLElement | jQuery

The scale cell.

scaleIndex

Number

Specifies the scale's index.

scaleType

GanttRenderScaleType

The scale type.

separatorElement

HTMLElement | jQuery

The separator after the scale cell.

endDate

Date

The end date of the scale cell.

startDate

Date

The start date of the scale cell.

Default Value: null

The example below illustrates how to customize the scale.

DevExtreme Gantt - Customize Scale

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onScaleCellPrepared={this.onScaleCellPrepared}
  • />
  • );
  • }
  • onScaleCellPrepared: function(e) {
  • var scaleElement = e.scaleElement[0];
  • if(e.scaleIndex === 0) {
  • scaleElement.style.backgroundColor = "silver";
  • scaleElement.innerText = "bottom";
  • } else {
  • scaleElement.style.backgroundColor = "LightSteelBlue";
  • scaleElement.innerText = "top";
  • }
  • var border = e.separatorElement[0];
  • border.style.borderColor = "steelBlue";
  • }
  • }
  • export default App;

The code below colors the scale cells depending on the season:

DevExtreme Gantt - Customize Scale by Seasons

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onScaleCellPrepared={this.onScaleCellPrepared}
  • />
  • );
  • }
  • onScaleCellPrepared: function(e) {
  • var scaleElement = e.scaleElement;
  • var color = "";
  • var month = e.end.getMonth();
  • if (month > 1 && month < 5) {
  • color = "lightGreen";
  • } else if (month > 4 && month < 8) {
  • color = "green";
  • } else if (month > 7 && month < 11) {
  • color = "yellow";
  • } else
  • color = "white";
  • scaleElement.style.backgroundColor = color;
  • }
  • }
  • export default App;

onSelectionChanged

A function that is executed after users select a task or clear its selection.

Selector: @selection-changed
Type:

Function

Function parameters:

Information about the event that caused the function's execution.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

selectedRowKey any

The key of the row whose selection state was changed.

Default Value: null

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onSelectionChanged={this.onSelectionChanged}
  • />
  • );
  • }
  • onSelectionChanged = (e) => {
  • if (e.selectedRowKey === 2) {
  • // your code
  • } else {
  • // your code
  • }
  • }
  • }
  • export default App;
See Also

onTaskClick

A function that is executed when a user clicks a task.

Selector: @task-click
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

data any

The task data.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

key any

The task key.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onTaskClick={this.onTaskClick}
  • />
  • );
  • }
  • onTaskClick = (e) => {
  • if (e.key != 0) {
  • // your code
  • }
  • }
  • }
  • export default App;
See Also

onTaskDblClick

A function that is executed when a user double-clicks a task.

Selector: @task-dbl-click
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the resource unassignment.

component

Gantt

The UI component's instance.

data any

The task data.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

key any

The task key.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onTaskDblClick={this.onTaskDblClick}
  • />
  • );
  • }
  • onTaskDblClick = (e) => {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onTaskDeleted

A function that is executed when a task is deleted.

Selector: @task-deleted
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the deleted task.

values any

The values of the deleted task.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onTaskDeleted={this.onTaskDeleted}
  • />
  • );
  • }
  • onTaskDeleted = (e) => {
  • if (e.key != 0) {
  • // your code
  • }
  • }
  • }
  • export default App;
See Also

onTaskDeleting

A function that is executed before a task is deleted.

Selector: @task-deleting
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the task deletion.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the deleted task.

values any

The values of the deleted task.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onTaskDeleting={this.onTaskDeleting}
  • />
  • );
  • }
  • onTaskDeleting = (e) => {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onTaskEditDialogShowing

A function that is executed before the edit dialog is shown.

Selector: @task-edit-dialog-showing
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the edit dialog showing.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

hiddenFields

Array<String>

An array of hidden fields.

key any

The task key.

readOnlyFields

Array<String>

An array of read-only fields.

values any

The task values.

Default Value: null

The hiddenFields and readOnlyFields parameters affect only task fields. Disable the allowTaskResourceUpdating property to freeze the Resource Manager in the Task Details dialog.

DevExtreme Gantt Chart - Task Edit Dialog

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onTaskEditDialogShowing={this.onTaskEditDialogShowing}
  • />
  • );
  • }
  • onTaskEditDialogShowing = (e) => {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onTaskInserted

A function that is executed when a task is inserted.

Selector: @task-inserted
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the inserted task.

values any

The values of the inserted task.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onTaskInserted={this.onTaskInserted}
  • />
  • );
  • }
  • onTaskInserted = (e) => {
  • if (e.values.text == " ") {
  • // your code
  • }
  • }
  • }
  • export default App;
See Also

onTaskInserting

A function that is executed before a task is inserted.

Selector: @task-inserting
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the task insertion.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

values any

The values of the inserted task.

Default Value: null

DevExtreme Gantt Chart - Task Element

Note that you should not specify a task ID in the onTaskInserting function.

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onTaskInserting={this.onTaskInserting}
  • />
  • );
  • }
  • onTaskInserting = (e) => {
  • if (e.values.text == " ") {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onTaskMoving

A function that is executed before a task is moved.

Selector: @task-moving
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the task's movement.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The task key.

newValues any

The task values after moving.

values any

The task values before moving.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onTaskMoving={this.onTaskMoving}
  • />
  • );
  • }
  • onTaskMoving = (e) => {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

onTaskUpdated

A function that is executed when a task is updated.

Selector: @task-updated
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The key of the updated task.

values any

The task values after update.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onTaskUpdated={this.onTaskUpdated}
  • />
  • );
  • }
  • onTaskUpdated = (e) => {
  • if (e.key != 0) {
  • // your code
  • }
  • }
  • }
  • export default App;
See Also

onTaskUpdating

A function that is executed before a task is updated.

Selector: @task-updating
Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel the task update.

component

Gantt

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

key any

The task key.

newValues any

The task values after update.

values any

The task values before update.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Gantt from 'devextreme-react/gantt';
  •  
  • class App extends React.Component {
  • // ...
  • render() {
  • return (
  • <Gantt
  • //...
  • onTaskUpdating={this.onTaskUpdating}
  • />
  • );
  • }
  • onTaskUpdating = (e) => {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • export default App;
See Also

resourceAssignments

Configures resource assignments.

Selector: DxResourceAssignments
Type:

Object

Default Value: null

View Demo

Resource assignments define relationship between tasks and resources.

Use the dataSource property to bind the UI component to a data source, which contains resource assignments. If the field names in your data source differ from the 'id', 'resourceId' and 'taskId' default names, use the keyExpr, resourceIdExpr and/or taskIdExpr properties to map data fields.

See Also
App.js
data.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • ResourceAssignments,
  • //...
  • } from 'devextreme-react/gantt';
  • import {
  • resourceAssignments,
  • //...
  • } from './data.js';
  •  
  • const App = () => {
  • return (
  • <Gantt ... >
  • <ResourceAssignments
  • dataSource={resourceAssignments}
  • keyExpr="key"
  • resourceIdExpr="resourceKey"
  • taskIdExpr="taskKey" />
  • </Gantt>
  • );
  • };
  •  
  • export default App;
  • export const resourceAssignments = [{
  • 'key': 0,
  • 'taskKey': 3,
  • 'resourceKey': 1
  • },
  • // ...
  • ];

resources

Configures task resources.

Selector: DxResources
Type:

Object

Default Value: null

View Demo

You can add resources to a project and assign them to tasks. Resources can be people responsible for tasks, equipment, materials, etc. The Gantt displays resources as labels on the right of the tasks.

DevExtreme Gantt Chart - Resources

Use the dataSource property to bind the UI component to a data source, which contains resources. If the field names in your data source differ from the 'id', 'text' and 'color' default names, use the keyExpr, textExpr and/or colorExpr properties to map data fields.

The 'color' field accepts the following values:

App.js
data.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • Resources,
  • // ...
  • } from 'devextreme-react/gantt';
  • import {
  • resources,
  • // ...
  • } from './data.js';
  •  
  • const App = () => {
  • return (
  • <Gantt ... >
  • <Resources
  • dataSource={resources}
  • keyExpr="resourceId"
  • textExpr="title"
  • colorExpr="resourceColor" />
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;
  • export const resources = [{
  • 'resourceId': 1,
  • 'title': 'Management',
  • 'resourceColor': 'red'
  • },
  • // ...
  • ];
See Also

rootValue

Specifies the root task's identifier.

Selector: root-value
Type: any
Default Value: 0

scaleType

Specifies the zoom level of tasks in the Gantt chart.

Selector: scale-type
Default Value: 'auto'

The scaleType property specifies the zoom level for tasks when the Gantt UI component is initialized or when you call the option() method.

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt
  • scaleType="hours" >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

If the scaleType property is set to "auto", the UI component's scale type is calculated based on the time difference between the start of the first task and the end of the final task. For example, if this difference is more than a year, the scaleType property is set to 'years'.

To browse tasks across various levels of detail in real time, hold the CTRL key and scroll the mouse wheel to zoom (in or out).

scaleTypeRange

Configures zoom range settings.

Selector: DxScaleTypeRange
Type:

Object

Use the scaleTypeRange.min and scaleTypeRange.max properties to limit zoom in the Gantt chart.

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • ScaleTypeRange ,
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt ... >
  • <ScaleTypeRange
  • min="days"
  • max="years" />
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;
See Also

selectedRowKey

Allows you to select a row or determine which row is selected.

Selector: selected-row-key
Type: any | undefined
Default Value: undefined

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt
  • selectedRowKey={1} >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;
See Also

showDependencies

Specifies whether to display dependencies between tasks.

Selector: show-dependencies
Type:

Boolean

Default Value: true

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt
  • showResources={false} >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

showResources

Specifies whether to display task resources.

Selector: show-resources
Type:

Boolean

Default Value: true

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt
  • showResources={false} >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

showRowLines

Specifies whether to show/hide horizontal faint lines that separate tasks.

Selector: show-row-lines
Type:

Boolean

Default Value: true

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt
  • showRowLines={false} >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

sorting

Configures sort settings.

Selector: DxSorting

View Demo

Users can sort Gantt data by a single or multiple columns. Use the mode option to specify the sort mode.

  • Single Mode. Click a column header to sort data by this column. Subsequent clicks on the same header reverse the sort order.

    DevExtreme Gantt - Sorting

  • Multiple Mode. Hold Shift and click column headers to sort data by multiple columns. Subsequent clicks on the same header with the Shift key pressed reverse the column's sort order. Set the showSortIndexes option to true to show the column sort index in the header.

    DevExtreme Gantt - Sorting

To disable sorting for a particular column, set the column’s allowSorting option to false.

To clear sorting for a column, hold Ctrl and click the column header. You can also use the column header’s context menu to specify the column’s sort settings and clear sorting. Use the ascendingText, descendingText, and the clearText options to specify text for the corresponding context menu items.

DevExtreme Gantt - Sorting

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • Sorting,
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt ... >
  • <Sorting
  • mode="multiple"
  • showSortIndexes={true}
  • ascendingText="Ascending Order"
  • descendingText="Descending Order"
  • clearText="Clear Sort" />
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

startDateRange

Specifies the start date of the date interval in the Gantt chart.

Selector: start-date-range
Type:

Date

Default Value: null

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • const startDateRange = new Date(2018, 1, 1);
  • const endDateRange = new Date(2020, 1, 1);
  •  
  • return (
  • <Gantt
  • startDateRange = {startDateRange}
  • endDateRange = {endDateRange} >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;
See Also

stripLines[]

Configures strip lines.

Selector: DxStripLine
Default Value: undefined

View Demo

Strip lines allows you to highlight certain time or time intervals in the chart. Use the start property to specify an individual line or combine it with the end property setting to specify a time interval.

DevExtreme Gantt - Strip Lines

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt>
  • <StripLine start={tasks[0].start} title="Start" />
  • <StripLine start={tasks[tasks.length - 3].start} end={tasks[tasks.length - 1].end} title="Final Phase" />
  • <StripLine start={currentDate} title="Current Time" cssClass="current-time" />
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

tabIndex

Specifies the number of the element when the Tab key is used for navigating.

Selector: tab-index
Type:

Number

Default Value: 0

The value of this property will be passed to the tabindex attribute of the HTML element that underlies the UI component.

taskContentTemplate

Specifies custom content for the task.

Selector: task-content-template
Type:

template

Template Data:
Name Type Description
cellSize

Object

The size of the cell that contains the task.

isMilestone

Boolean

Specifies whether the task is a milestone.

taskData

Object

The processed task.

taskHTML

Object

The default HTML element of the processed task.

taskPosition

Object

The task's position.

taskResources

Array<Object>

The task's resources.

taskSize

Object

The task's size.

View Demo

App.js
  • import React from 'react';
  • import Gantt from 'devextreme-react/gantt';
  • import { Template } from 'devextreme-react/core/template';
  •  
  • const TaskTemplate = (item) => {
  • return (
  • <div className="custom-task" style={{width: item.taskSize.width + "px"}}>
  • <div className="custom-task-title">{item.taskData.title}</div>
  • </div>
  • );
  • }
  •  
  • export default function App() {
  • return (
  • <Gantt
  • taskContentRender={TaskTemplate}>
  • //...
  • </Gantt>
  • );
  • }
  •  
  • export default App;

taskListWidth

Specifies the width of the task list in pixels.

Selector: task-list-width
Type:

Number

Default Value: 300

View Demo

DevExtreme Gantt Chart - Task List

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt
  • taskListWidth={200} >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

taskProgressTooltipContentTemplate

Specifies custom content for the tooltip that displays the task's progress while the progress handler is resized in the UI.

Selector: task-progress-tooltip-content-template
Type:

template

Template Data:
Name Type Description
progress

Number

The task's progress.

App.js
  • import React from 'react';
  • import Gantt from 'devextreme-react/gantt';
  • import { Template } from 'devextreme-react/core/template';
  •  
  • const TaskProgressTooltipTemplate = (item) => {
  • return (
  • <div className="custom-tooltip">
  • <div className="custom-tooltip-progress">Progress: {item.progress}%</div>
  • <!-- ... -->
  • </div>
  • );
  • }
  •  
  • export default function App() {
  • return (
  • <Gantt
  • taskProgressTooltipContentRender={TaskProgressTooltipTemplate}>
  • //...
  • </Gantt>
  • );
  • }
  •  
  • export default App;

tasks

Configures tasks.

Selector: DxTasks
Type:

Object

Default Value: null

View Demo

DevExtreme Gantt Chart - Tasks

Use the dataSource property to bind the UI component to a data source, which contains tasks. If the field names in your data source differ from default names ('id', 'parentId', 'title', 'start', 'end', 'progress', 'color'), use appropriate properties (keyExpr, parentIdExpr, etc.) to map data fields.

The 'color' field accepts the following values:

NOTE
The 'id' and 'parentId' fields should not have the same value.
App.js
data.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • Tasks,
  • // ...
  • } from 'devextreme-react/gantt';
  • import {
  • tasks,
  • // ...
  • } from './data.js';
  •  
  • const App = () => {
  • return (
  • <Gantt ... >
  • <Tasks
  • dataSource={tasks}
  • keyExpr="taskId"
  • parentIdExpr="parentTaskId"
  • titleExpr="taskTitle"
  • progressExpr="taskProgress"
  • startExpr="startDate"
  • endExpr="endDate"
  • colorExpr="taskColor" />
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;
  • export const tasks = [{
  • 'taskId': 1,
  • 'parentTaskId': 0,
  • 'taskTitle': 'Software Development',
  • 'startDate': new Date('2019-02-21T05:00:00.000Z'),
  • 'endDate': new Date('2019-07-04T12:00:00.000Z'),
  • 'taskProgress': 31,
  • 'taskColor': 'red'
  • },
  • // ...
  • ];
See Also

taskTimeTooltipContentTemplate

Specifies custom content for the tooltip that displays the task's start and end time while the task is resized in the UI.

Selector: task-time-tooltip-content-template
Type:

template

Template Data:
Name Type Description
end

Date

The task's end date.

start

Date

The task's start date.

App.js
  • import React from 'react';
  • import Gantt from 'devextreme-react/gantt';
  • import { Template } from 'devextreme-react/core/template';
  •  
  • const TaskTimeTooltipTemplate = (item) => {
  • return (
  • <div className="custom-tooltip">
  • <div className="custom-tooltip-time">End Date: {item.end}</div>
  • <!-- ... -->
  • </div>
  • );
  • }
  •  
  • export default function App() {
  • return (
  • <Gantt
  • taskTimeTooltipContentRender={TaskTimeTooltipTemplate}>
  • //...
  • </Gantt>
  • );
  • }
  •  
  • export default App;

taskTitlePosition

Specifies a task's title position.

Selector: task-title-position
Default Value: 'inside'

Titles can be displayed "inside" or "outside" the the task. Set the position to "none" to hide the title.

DevExtreme Gantt Chart - Task titles

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt
  • taskTitlePosition="none" >
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

taskTooltipContentTemplate

Specifies custom content for the task tooltip.

Selector: task-tooltip-content-template
Type:

template

Template Data:

HTMLElement | jQuery

The task tooltip's container. It is an HTML Element or a jQuery Element when you use jQuery.

View Demo

App.js
  • import React from 'react';
  • import Gantt from 'devextreme-react/gantt';
  • import { Template } from 'devextreme-react/core/template';
  •  
  • const TaskTooltipTemplate = (task) => {
  • return (
  • <div class="custom-task-edit-tooltip">
  • <div class="custom-tooltip-title">{{ task.title }}</div>
  • <!-- ... -->
  • </div>
  • );
  • }
  •  
  • export default function App() {
  • return (
  • <Gantt
  • taskTooltipContentRender={TaskTooltipTemplate}>
  • //...
  • </Gantt>
  • );
  • }
  •  
  • export default App;

toolbar

Configures toolbar settings.

Selector: DxToolbar
Default Value: null

validation

Configures validation properties.

Selector: DxValidation
Type:

Object

View Demo

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import Gantt, {
  • Validation,
  • // ...
  • } from 'devextreme-react/gantt';
  •  
  • const App = () => {
  • return (
  • <Gantt ... >
  • <Validation
  • autoUpdateParentTasks={true}
  • validateDependencies={true} />
  • {/* ... */}
  • </Gantt>
  • );
  • };
  •  
  • export default App;

visible

Specifies whether the UI component is visible.

Type:

Boolean

Default Value: true

width

Specifies the UI component's width.

Type:

Number

|

String

|

Function

| undefined
Return Value:

Number

|

String

The UI component's width.

Default Value: undefined

This property accepts a value of one of the following types:

  • Number
    The width in pixels.

  • String
    A CSS-accepted measurement of width. For example, "55px", "20vw", "80%", "auto", "inherit".

  • Function (deprecated since v21.2)
    Refer to the W0017 warning description for information on how you can migrate to viewport units.