GanttComponent
Represents the Kendo UI Gantt component for Angular.
Use the Gantt component to display and manage project tasks and dependencies in a timeline view.
import { Component } from '@angular/core';
import { GanttComponent, DependencyType } from '@progress/kendo-angular-gantt';
@Component({
selector: 'my-app',
template: `
<kendo-gantt
[style.height.px]="500"
[kendoGanttHierarchyBinding]="data"
childrenField="subtasks"
[dependencies]="dependencies">
<kendo-gantt-column field="title" title="Task" [width]="200" [expandable]="true"></kendo-gantt-column>
<kendo-gantt-column field="start" title="Start" format="dd-MMM-yyyy" [width]="120"></kendo-gantt-column>
<kendo-gantt-column field="end" title="End" format="dd-MMM-yyyy" [width]="120"></kendo-gantt-column>
<kendo-gantt-timeline-day-view></kendo-gantt-timeline-day-view>
<kendo-gantt-timeline-week-view></kendo-gantt-timeline-week-view>
<kendo-gantt-timeline-month-view></kendo-gantt-timeline-month-view>
</kendo-gantt>
`
})
export class AppComponent {
public data: Task[] = [
{
id: 1,
title: 'Planning',
start: new Date('2024-01-01'),
end: new Date('2024-01-05'),
subtasks: []
}
];
public dependencies = [
{ id: 1, fromId: 1, toId: 2, type: DependencyType.FS }
];
}
Selector
kendo-gantt
Export Name
Accessible in templates as #kendoGanttInstance="kendoGantt"
Inputs
Name | Type | Default | Description |
---|---|---|---|
activeView |
|
|
Sets the active timeline view. |
columnMenu |
|
|
Enables the column menu for all columns. |
columnsAutoSize |
|
|
Enables automatic resizing of columns to fit their content. |
columnsReorderable |
|
|
Enables reordering of the columns by dragging their header cells. |
columnsResizable |
|
|
Enables resizing of the columns by dragging the header cell edges (resize handles). |
currentTimeMarker |
|
|
Sets the current time marker settings for the Gantt. Applies to all views unless overridden by the settings of a particular view. |
data |
|
Gets or sets the Gantt data.
The task data items must match the | |
dependencies |
|
Sets the dependencies to display between tasks.
Dependency data items must match the | |
dependencyModelFields |
|
Sets the fields used to extract dependency data from the | |
dragScrollSettings |
|
Defines the settings for auto-scrolling during dragging when the pointer moves outside the container (see example). | |
fetchChildren |
|
Sets the callback function to retrieve child items for a data item. | |
filter |
|
Sets the descriptor for filtering the data. | |
filterable |
|
|
Enables filtering for columns with a |
hasChildren |
|
Sets the callback function to indicate if a data item has child items. | |
isExpanded |
|
Sets a callback function to indicate if a data item is expanded. If not set, all items are expanded and no expand icons are shown. | |
isSelected |
|
Specifies a callback to determine if a task is selected (see example).
Set | |
navigable |
|
|
Enables keyboard navigation for the Gantt. By default, navigation is enabled for the TreeList and Timeline parts of the component (see example). |
rowClass |
|
Sets a function to apply custom CSS classes to each data row. The function receives the row data item. | |
selectable |
|
|
Enables or disables selection in the Gantt (see example).
Set to
|
sort |
|
Sets the descriptors for sorting the data. | |
sortable |
|
Enables sorting for columns with a | |
taskClass |
|
Sets a function to apply custom CSS classes to each task. The function receives the task data item. | |
taskModelFields |
|
Sets the fields used to extract task data from the | |
taskTooltipOptions |
|
|
Sets the options for the task tooltip, such as |
timelinePaneOptions |
|
Sets the options for the timeline splitter pane.
By default, the pane is collapsible, resizable, not collapsed, and its size is | |
toolbarAriaLabel |
|
|
Sets the |
toolbarSettings |
|
Configures the toolbar position and content.
Set | |
treeListPaneOptions |
|
Sets the options for the treelist splitter pane. By default the pane is collapsible and not collapsed. | |
validateNewDependency |
|
Specifies a callback to validate new dependencies. Use this callback to control the valid dependencies that users can create (see example). | |
workDayEnd |
|
|
Sets the end time of the work day in |
workDayStart |
|
|
Sets the start time of the work day in |
workWeekEnd |
|
|
Sets the end day of the work week (index based). |
workWeekStart |
|
|
Sets the start day of the work week (index based). |
Fields
Name | Type | Default | Description |
---|---|---|---|
columns |
|
A query list of all declared columns. | |
taskIdField |
|
|
Gets the name of the field that contains the unique identifier for task data items. |
views |
|
A query list of all declared views. |
Events
Name | Type | Description |
---|---|---|
activeViewChange |
|
Fires when the user selects a different view type. The event data contains the type of the new view. |
cancel |
|
Fires when the user cancels editing a task. |
cellClick |
|
Fires when a cell is clicked. |
cellClose |
|
Fires when an edited cell is closed. |
cellDblClick |
|
Fires when a cell is double-clicked. |
columnReorder |
|
Fires when the user completes reordering a column. |
columnResize |
|
Fires when the user completes resizing a column. |
columnVisibilityChange |
|
Fires when the user changes column visibility from the column menu or chooser. |
dataStateChange |
|
Fires when the filter or sort state changes. |
dependencyAdd |
|
Fires when the user adds a dependency by dragging see example. |
filterChange |
|
Fires when there are changes in the Gantt filtering. Handle this event to filter the data. |
remove |
|
Fires when the user confirms deleting a task. |
rowCollapse |
|
Fires when a row is collapsed. |
rowExpand |
|
Fires when a row is expanded. |
save |
|
Fires when the user saves an edited task. |
selectionChange |
|
Fires when the Gantt selection changes through user interaction. The event data contains the affected items and the action type. |
sortChange |
|
Fires when there are changes in the Gantt sorting. Handle this event to sort the data. |
taskAdd |
|
Fires when the user adds a task. |
taskClick |
|
Fires when a task is clicked. |
taskDblClick |
|
Fires when a Gantt task in the timeline pane is double-clicked. The event data contains the clicked task. Use this event to open a task editing dialog if needed. |
taskDelete |
|
Fires when the user clicks the |
timelinePaneCollapsedChange |
|
Fires when the collapsed state of the timeline pane changes. |
timelinePaneSizeChange |
|
Fires when the user resizes the timeline pane. |
treeListPaneCollapsedChange |
|
Fires when the collapsed state of the treelist pane changes. |
Methods
autoFitColumn | ||||||
---|---|---|---|---|---|---|
Sets the minimum width for the specified column so that its content fits. The Gantt must be resizable. | ||||||
|
autoFitColumns | ||||||
---|---|---|---|---|---|---|
Adjusts the width of the specified columns to fit their content. If no columns are specified, fits all columns. The Gantt must be resizable to use this method. | ||||||
|
closeCell |
---|
Closes the currently edited cell. |
closeTaskDialog |
---|
Closes the task editing dialog. |
editCell | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Opens a cell for editing. | ||||||||||||
|
editTask | |||||||||
---|---|---|---|---|---|---|---|---|---|
Opens the task editing dialog for the specified data item. | |||||||||
|
focus |
---|
Focuses the last active cell or task in the Gantt. If no item was previously focused, focuses the first TreeList cell (see example). |
focusCell | |||||||||
---|---|---|---|---|---|---|---|---|---|
Focuses the specified cell in the TreeList (see example). | |||||||||
|
focusTask | ||||||
---|---|---|---|---|---|---|
Focuses the specified task in the Timeline (see example). | ||||||
|
openConfirmationDialog |
---|
Opens the delete task confirmation dialog. |
reload | |||||||||
---|---|---|---|---|---|---|---|---|---|
Clears loaded children for the data item so the Gantt fetches them again. | |||||||||
|
reorderColumn | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Changes the position of the specified column. The source column must be visible. | ||||||||||||
|
updateView |
---|
Forces the Gantt to re-evaluate data items and re-render the rows and Timeline period, if needed. Also redraws dependencies and executes row-related callbacks. |