Vue Gantt Props

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

See Also

accessKey

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

Selector: access-key
Type:

String

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 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. See the following GitHub repository for an example of this type of platform: MUI.

allowSelection

Specifies whether users can select tasks in the Gantt.

Selector: allow-selection
Type:

Boolean

Default Value: true

View Demo

App.vue
  • <template>
  • <DxGantt
  • :allow-selection="false" >
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • // ...
  • }
  • };
  • </script>
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 dxTreeListColumn 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:

  • data sorting

  • column templates

View Demo

App.vue
  • <template>
  • <DxGantt
  • :allow-selection="false" >
  • <DxColumn
  • :width="300"
  • data-field="title"
  • caption="Subject"
  • />
  • <DxColumn
  • data-field="start"
  • caption="Start Date"
  • />
  • <DxColumn
  • data-field="end"
  • caption="End Date"
  • />
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt, DxColumn
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt, DxColumn
  • // ...
  • }
  • };
  • </script>

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.vue
data.js
  • <template>
  • <DxGantt ... >
  • <DxDependencies
  • :data-source="dependencies"
  • key-expr="dependencyId"
  • type-expr="dependencyType"
  • predecessor-id-expr="taskPredecessorId"
  • successor-id-expr="taskSuccessorId" />
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt,
  • DxDependencies,
  • // ...
  • } from 'devextreme-vue/gantt';
  • import {
  • dependencies,
  • // ...
  • } from './data.js';
  •  
  • export default {
  • components: {
  • DxGantt,
  • DxDependencies,
  • // ...
  • },
  • data() {
  • return {
  • dependencies,
  • // ...
  • };
  • }
  • };
  • </script>
  • 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.vue
  • <template>
  • <DxGantt ... >
  • <DxEditing
  • :enabled="true"
  • :allow-dependency-adding="false"
  • :allow-dependency-deleting="false"
  • :allow-resource-adding="false"
  • :allow-resource-deleting="false"
  • :allow-task-adding="false"
  • :allow-task-deleting="false"
  • :allow-task-resource-updating="false"
  • :allow-task-updating="false"
  • />
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt,
  • DxEditing,
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt,
  • DxEditing,
  • // ...
  • }
  • };
  • </script>
See Also

elementAttr

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

Selector: element-attr
Type: any
Default Value: {}

App.vue
  • <template>
  • <DxGantt ...
  • :element-attr="ganttAttributes">
  • </DxGantt>
  • </template>
  •  
  • <script>
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • data() {
  • return {
  • ganttAttributes: {
  • id: 'elementId',
  • class: 'class-name'
  • }
  • }
  • }
  • }
  • </script>

firstDayOfWeek

Specifies the first day of a week.

Selector: first-day-of-week
Type:

Number

Default Value: undefined
Accepted Values: 0 | 1 | 2 | 3 | 4 | 5 | 6

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.vue
  • <template>
  • <DxGantt
  • :first-day-of-week="1" >
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • // ...
  • }
  • };
  • </script>

focusStateEnabled

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

Selector: focus-state-enabled
Type:

Boolean

Default Value: false

height

Specifies the UI component's height.

Type:

Number

|

String

|

Function

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", "80%", "inherit".

  • Function
    A function returning either of the above. For example:

    JavaScript
    • height: function() {
    • return window.innerHeight / 1.5;
    • }

hint

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

Type:

String

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's content is ready and each time the content is changed.

Selector: @content-ready
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only when using Knockout.

Default Value: null

onContextMenuPreparing

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

Selector: @context-menu-preparing
Type:

Function

Function parameters:
e:

Object

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.vue
  • <template>
  • <DxGantt
  • ...
  • @context-menu-preparing="onContextMenuPreparing"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onContextMenuPreparing(e) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • </script>

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:
e:

Object

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.vue
  • <template>
  • <DxGantt
  • ...
  • @custom-command="onCustomCommand"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onCustomCommand(e) {
  • // your code
  • }
  • }
  • }
  • </script>
See Also

onDependencyDeleted

A function that is executed when a dependency is deleted.

Selector: @dependency-deleted
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the deleted dependency.

Default Value: null

DevExtreme Gantt - Dependency

App.vue
  • <template>
  • <DxGantt
  • ...
  • @dependency-deleted="onDependencyDeleted"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onDependencyDeleted(e) {
  • if (e.key != 1)
  • // your code
  • }
  • }
  • }
  • </script>
See Also

onDependencyDeleting

A function that is executed before a dependency is deleted.

Selector: @dependency-deleting
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the deleted dependency.

Default Value: null

DevExtreme Gantt - Dependency

App.vue
  • <template>
  • <DxGantt
  • ...
  • @dependency-deleting="onDependencyDeleting"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onDependencyDeleting(e) {
  • if (e.key != 1) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onDependencyInserted

A function that is executed when a dependency is inserted.

Selector: @dependency-inserted
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the inserted dependency.

Default Value: null

DevExtreme Gantt - Dependency

App.vue
  • <template>
  • <DxGantt
  • ...
  • @dependency-inserted="onDependencyInserted"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onDependencyInserted(e) {
  • if (e.values.type == 3) {
  • // your code
  • }
  • }
  • }
  • }
  • </script>
See Also

onDependencyInserting

A function that is executed before a dependency is inserted.

Selector: @dependency-inserting
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the inserted dependency.

Default Value: null

DevExtreme Gantt - Dependency

App.vue
  • <template>
  • <DxGantt
  • ...
  • @dependency-inserting="onDependencyInserting"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onDependencyInserting(e) {
  • if (e.values.type == 3) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onDisposing

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

Selector: @disposing
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

Default Value: null

onInitialized

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

Selector: @initialized
Type:

Function

Function parameters:
e:

Object

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.

Default Value: null

See Also

onOptionChanged

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

Selector: @option-changed
Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
model any

Model data. Available only if you use Knockout.

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.

name

String

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

value any

The modified property's new value.

Default Value: null

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

App.vue
  • <template>
  • <DxGantt ...
  • @option-changed="handlePropertyChange"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • // ...
  • methods: {
  • handlePropertyChange: function(e) {
  • if(e.name === "changedProperty") {
  • // handle the property change here
  • }
  • }
  • }
  • }
  • </script>

onResourceAssigned

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

Selector: @resource-assigned
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the processed resource and task.

Default Value: null

DevExtreme Gantt Chart - Resources

App.vue
  • <template>
  • <DxGantt
  • ...
  • @resource-assigned="onResourceAssigned"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onResourceAssigned(e) {
  • if (e.values.taskID != 0) {
  • // your code
  • }
  • }
  • }
  • }
  • </script>
See Also

onResourceAssigning

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

Selector: @resource-assigning
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the processed resource and task.

Default Value: null

DevExtreme Gantt Chart - Resources

App.vue
  • <template>
  • <DxGantt
  • ...
  • @resource-assigning="onResourceAssigning"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onResourceAssigning(e) {
  • if (e.values.taskID != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onResourceDeleted

A function that is executed when a resource is deleted.

Selector: @resource-deleted
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the deleted resource.

Default Value: null

DevExtreme Gantt Chart - Resources

App.vue
  • <template>
  • <DxGantt
  • ...
  • @resource-deleted="onResourceDeleted"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onResourceDeleted(e) {
  • if (e.key == 0) {
  • // your code
  • }
  • }
  • }
  • }
  • </script>
See Also

onResourceDeleting

A function that is executed before a resource is deleted.

Selector: @resource-deleting
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the deleted resource.

Default Value: null

DevExtreme Gantt Chart - Resources

App.vue
  • <template>
  • <DxGantt
  • ...
  • @resource-deleting="onResourceDeleting"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onResourceDeleting(e) {
  • if (e.key == 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onResourceInserted

A function that is executed when a resource is inserted.

Selector: @resource-inserted
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the inserted resource.

Default Value: null

DevExtreme Gantt Chart - Resources

App.vue
  • <template>
  • <DxGantt
  • ...
  • @resource-inserted="onResourceInserted"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onResourceInserted(e) {
  • if (e.values.text == " "){
  • // your code
  • }
  • }
  • }
  • }
  • </script>
See Also

onResourceInserting

A function that is executed before a resource is inserted.

Selector: @resource-inserting
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the inserted resource.

Default Value: null

DevExtreme Gantt Chart - Resources

App.vue
  • <template>
  • <DxGantt
  • ...
  • @resource-inserting="onResourceInserting"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onResourceInserting(e) {
  • if (e.values.text == " "){
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onResourceManagerDialogShowing

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

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

Function

Function parameters:
e:

Object

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' values.

Default Value: null

DevExtreme Gantt - Invoke Resource Manager

Use the onResourceManagerDialogShowing function to customize the Resource Manager dialog before it is invoked. You can also use the showResourceManagerDialog method or the "Resource Manager" toolbar item to invoke the Resource Manager.

The allowTaskResourceUpdating property allows you to hide the Resource Manager button in the Task Details dialog.

App.vue
  • <template>
  • <DxGantt
  • ...
  • @resource-manager-dialog-showing="onResourceManagerDialogShowing"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onResourceManagerDialogShowing(e) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • </script>
See Also

onResourceUnassigned

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

Selector: @resource-unassigned
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the processed resource and task.

Default Value: null

DevExtreme Gantt Chart - Resources

App.vue
  • <template>
  • <DxGantt
  • ...
  • @resource-unassigned="onResourceUnassigned"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onResourceUnassigned(e) {
  • if (e.key != 0) {
  • // your code
  • }
  • }
  • }
  • }
  • </script>
See Also

onResourceUnassigning

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

Selector: @resource-unassigning
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the processed resource and task.

Default Value: null

DevExtreme Gantt Chart - Resources

App.vue
  • <template>
  • <DxGantt
  • ...
  • @resource-unassigning="onResourceUnassigning"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onResourceUnassigning(e) {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onSelectionChanged

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

Selector: @selection-changed
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

selectedRowKey any

The key of the row whose selection state was changed.

Default Value: null

View Demo

App.vue
  • <template>
  • <DxGantt
  • ...
  • @selection-changed="onSelectionChanged"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onSelectionChanged(e) {
  • if (e.selectedRowKey === 2) {
  • // your code
  • } else {
  • // your code
  • }
  • }
  • }
  • }
  • </script>
See Also

onTaskClick

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

Selector: @task-click
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.vue
  • <template>
  • <DxGantt
  • ...
  • @task-click="onTaskClick"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onTaskClick(e) {
  • if (e.key != 0) {
  • // your code
  • }
  • }
  • }
  • }
  • </script>
See Also

onTaskDblClick

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

Selector: @task-dbl-click
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.vue
  • <template>
  • <DxGantt
  • ...
  • @task-dbl-click="onTaskDblClick"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onTaskDblClick(e) {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onTaskDeleted

A function that is executed when a task is deleted.

Selector: @task-deleted
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the deleted task.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.vue
  • <template>
  • <DxGantt
  • ...
  • @task-deleted="onTaskDeleted"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onTaskDeleted(e) {
  • if (e.key != 0) {
  • // your code
  • }
  • }
  • }
  • }
  • </script>
See Also

onTaskDeleting

A function that is executed before a task is deleted.

Selector: @task-deleting
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the deleted task.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.vue
  • <template>
  • <DxGantt
  • ...
  • @task-deleting="onTaskDeleting"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onTaskDeleting(e) {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onTaskEditDialogShowing

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

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

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

readOnlyFields

Array<String>

An array of read-only fields.

values any

The task values.

Default Value: null

Note that the hiddenFields and readOnlyFields parameters affect only task fields. Use the allowTaskResourceUpdating property to hide the Resource Manager in the Task Details dialog.

DevExtreme Gantt Chart - Task Edit Dialog

App.vue
  • <template>
  • <DxGantt
  • ...
  • @task-edit-dialog-showing="onTaskEditDialogShowing"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onTaskEditDialogShowing(e) {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onTaskInserted

A function that is executed when a task is inserted.

Selector: @task-inserted
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the inserted task.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.vue
  • <template>
  • <DxGantt
  • ...
  • @task-inserted="onTaskInserted"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onTaskInserted(e) {
  • if (e.values.text == " ") {
  • // your code
  • }
  • }
  • }
  • }
  • </script>
See Also

onTaskInserting

A function that is executed before a task is inserted.

Selector: @task-inserting
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The values of the inserted task.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.vue
  • <template>
  • <DxGantt
  • ...
  • @task-inserting="onTaskInserting"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onTaskInserting(e) {
  • if (e.values.text == " ") {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onTaskMoving

A function that is executed before a task is moved.

Selector: @task-moving
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

newValues any

The task values after moving.

values any

The task values before moving.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.vue
  • <template>
  • <DxGantt
  • ...
  • @task-moving="onTaskMoving"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onTaskMoving(e) {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
See Also

onTaskUpdated

A function that is executed when a task is updated.

Selector: @task-updated
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

values any

The task values after update.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.vue
  • <template>
  • <DxGantt
  • ...
  • @task-updated="onTaskUpdated"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onTaskUpdated(e) {
  • if (e.key != 0) {
  • // your code
  • }
  • }
  • }
  • }
  • </script>
See Also

onTaskUpdating

A function that is executed before a task is updated.

Selector: @task-updating
Type:

Function

Function parameters:
e:

Object

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.

model any

Model data. Available only if you use Knockout.

newValues any

The task values after update.

values any

The task values before update.

Default Value: null

DevExtreme Gantt Chart - Task Element

App.vue
  • <template>
  • <DxGantt
  • ...
  • @task-updating="onTaskUpdating"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxGantt from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • onTaskUpdating(e) {
  • if (e.key != 0) {
  • // your code
  • e.cancel = true;
  • }
  • }
  • }
  • }
  • </script>
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.vue
data.js
  • <template>
  • <DxGantt ... >
  • <DxResourceAssignments
  • :data-source="resourceAssignments"
  • key-expr="key"
  • resource-id-expr="resourceKey"
  • task-id-expr="taskKey" />
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt,
  • DxResourceAssignments,
  • //...
  • } from 'devextreme-vue/gantt';
  • import {
  • resourceAssignments,
  • // ...
  • } from './data.js';
  •  
  • export default {
  • components: {
  • DxGantt,
  • DxResourceAssignments,
  • //...
  • },
  • data() {
  • return {
  • resourceAssignments,
  • //...
  • };
  • }
  • };
  • </script>
  • 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.

See Also
App.vue
data.js
  • <template>
  • <DxGantt ... >
  • <DxResources
  • :data-source="resources"
  • key-expr="resourceId"
  • text-expr="title"
  • color-expr="resourceColor" />
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt,
  • DxResources,
  • // ...
  • } from 'devextreme-vue/gantt';
  • import {
  • resources,
  • // ...
  • } from './data.js';
  •  
  • export default {
  • components: {
  • DxGantt,
  • DxResources,
  • // ...
  • },
  • data() {
  • return {
  • resources,
  • // ...
  • };
  • }
  • };
  • </script>
  • export const resources = [{
  • 'resourceId': 1,
  • 'title': 'Management',
  • 'resourceColor': 'red'
  • },
  • // ...
  • ];

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
Type:

String

Default Value: 'auto'
Accepted Values: 'auto' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years'

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

App.vue
  • <template>
  • <DxGantt
  • :scale-type="hours" >
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • // ...
  • }
  • };
  • </script>

If the scaleType property is set to "auto", the UI component is scaled to fit all tasks in the Gantt chart's visible area.

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).

selectedRowKey

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

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

View Demo

App.vue
  • <template>
  • <DxGantt
  • :selected-row-key="1" >
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • // ...
  • }
  • };
  • </script>
See Also

showResources

Specifies whether to display task resources.

Selector: show-resources
Type:

Boolean

Default Value: true

View Demo

App.vue
  • <template>
  • <DxGantt
  • :show-resources="false" >
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • // ...
  • }
  • };
  • </script>

showRowLines

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

Selector: show-row-lines
Type:

Boolean

Default Value: true

App.vue
  • <template>
  • <DxGantt
  • :show-row-lines="false" >
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • // ...
  • }
  • };
  • </script>

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.vue
  • <template>
  • <DxGantt >
  • <DxStripLine
  • :start="tasks[0].start"
  • title="Start"
  • />
  • <DxStripLine
  • :start="tasks[tasks.length - 3].start"
  • :end="tasks[tasks.length - 1].end"
  • title="Final Phase"
  • />
  • <DxStripLine
  • :start="currentTime"
  • title="Current Time"
  • css-class="current-time"
  • />
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt, DxStripLine
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt, DxStripLine
  • // ...
  • }
  • };
  • </script>

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.

App.vue
  • <template>
  • <DxGantt
  • :task-content-template="myTaskTemplate" >
  • <template #myTaskTemplate="{ data : item }">
  • <div [style.width.px]="item.taskSize.width" class="custom-task">{{item.taskData.title}}</div>
  • <!-- ... -->
  • </template>
  • </DxGantt>
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.common.css';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { DxGantt } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • //...
  • },
  • data() {
  • return {
  • // ...
  • }
  • }
  • }
  • </script>

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.vue
  • <template>
  • <DxGantt
  • :task-list-width="200" >
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • // ...
  • }
  • };
  • </script>

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.vue
  • <template>
  • <DxGantt
  • :task-progress-tooltip-content-template="myTaskProgressTooltipTemplate" >
  • <template #myTaskProgressTooltipTemplate="{ data: item }">
  • <div class="custom-tooltip">
  • <div class="custom-tooltip-progress">Progress: {{ item.progress }}%</div>
  • <!-- ... -->
  • </div>
  • </template>
  • </DxGantt>
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.common.css';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { DxGantt } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • //...
  • },
  • data() {
  • return {
  • // ...
  • }
  • }
  • }
  • </script>

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.

Note that the 'id' and 'parentId' fields should not have the same value.

See Also
App.vue
data.js
  • <template>
  • <DxGantt ... >
  • <DxTasks
  • :data-source="tasks"
  • key-expr="taskId"
  • parent-id-expr="parentTaskId"
  • title-expr="taskTitle"
  • progress-expr="taskProgress"
  • start-expr="startDate"
  • end-expr="endDate"
  • color-expr="taskColor" />
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt,
  • DxTasks,
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • import {
  • tasks,
  • // ...
  • } from './data.js';
  •  
  • export default {
  • components: {
  • DxGantt,
  • DxTasks,
  • // ...
  • },
  • data() {
  • return {
  • tasks,
  • // ...
  • };
  • }
  • };
  • </script>
  • 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'
  • },
  • // ...
  • ];

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.vue
  • <template>
  • <DxGantt
  • :task-time-tooltip-content-template="myTaskTimeTooltipTemplate" >
  • <template #myTaskTimeTooltipTemplate="{ data: item }">
  • <div class="custom-tooltip">
  • <div class="custom-tooltip-time">End Date: {{item.end}}</div>
  • <!-- ... -->
  • </div>
  • </template>
  • </DxGantt>
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.common.css';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { DxGantt } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • //...
  • },
  • data() {
  • return {
  • // ...
  • }
  • }
  • }
  • </script>

taskTitlePosition

Specifies a task's title position.

Selector: task-title-position
Type:

String

Default Value: 'inside'
Accepted Values: 'inside' | 'outside' | 'none'

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.vue
  • <template>
  • <DxGantt
  • :task-title-position="none" >
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • // ...
  • }
  • };
  • </script>

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

Note that the container parameter contains the content of the default tooltip. You should clear the container parameter to specify custom content for the task tooltip.

App.vue
  • <template>
  • <DxGantt
  • :task-tooltip-content-template="myTooltipContentTemplate" >
  • <template #myTooltipContentTemplate="{ data: task }">
  • <div class="custom-task-edit-tooltip">
  • <div class="custom-tooltip-title">{{ task.title }}</div>
  • <!-- ... -->
  • </div>
  • </template>
  • </DxGantt>
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.common.css';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { DxGantt } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt
  • },
  • methods: {
  • //...
  • },
  • data() {
  • return {
  • // ...
  • }
  • }
  • }
  • </script>

toolbar

Configures toolbar settings.

Selector: DxToolbar
Default Value: null

validation

Configures validation properties.

Selector: DxValidation
Type:

Object

View Demo

App.vue
  • <template>
  • <DxGantt ... >
  • <DxValidation
  • :auto-update-parent-tasks="true"
  • :validate-dependencies="true"
  • />
  • <!-- ... -->
  • </DxGantt>
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  • import 'devexpress-gantt/dist/dx-gantt.css';
  •  
  • import {
  • DxGantt,
  • DxValidation,
  • // ...
  • } from 'devextreme-vue/gantt';
  •  
  • export default {
  • components: {
  • DxGantt,
  • DxValidation,
  • // ...
  • }
  • };
  • </script>

visible

Specifies whether the UI component is visible.

Type:

Boolean

Default Value: true

width

Specifies the UI component's width.

Type:

Number

|

String

|

Function

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", "80%", "auto", "inherit".

  • Function
    A function returning either of the above. For example:

    JavaScript
    • width: function() {
    • return window.innerWidth / 1.5;
    • }