GanttComponent
Represents the Kendo UI Gantt component for Angular.
@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>
`
})
class AppComponent {
public data: Task[] = [{
id: 7, title: 'Validation and R&D', start: new Date('2014-06-02T00:00:00.000Z'),
end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0.45708333333333334,
subtasks: [
{ id: 18, title: 'Project Kickoff', start: new Date('2014-06-02T00:00:00.000Z'),
end: new Date('2014-06-02T00:00:00.000Z'), completionRatio: 0.23 },
{ id: 11, title: 'Research', start: new Date('2014-06-02T00:00:00.000Z'),
end: new Date('2014-06-07T00:00:00.000Z'), completionRatio: 0.5766666666666667,
subtasks: [
{ id: 19, title: 'Validation', start: new Date('2014-06-02T00:00:00.000Z'),
end: new Date('2014-06-04T00:00:00.000Z'), completionRatio: 0.25 },
{ id: 39, title: 'Specification', start: new Date('2014-06-04T00:00:00.000Z'),
end: new Date('2014-06-07T00:00:00.000Z'), completionRatio: 0.66 }]
}, { id: 13, title: 'Implementation', start: new Date('2014-06-08T00:00:00.000Z'),
end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0.77,
subtasks: [
{ id: 24, title: 'Prototype', start: new Date('2014-06-08T00:00:00.000Z'),
end: new Date('2014-06-14T00:00:00.000Z'), completionRatio: 0.77 },
{ id: 29, title: 'UI and Interaction', start: new Date('2014-06-14T00:00:00.000Z'),
end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0.6 }]
}, { id: 17, title: 'Release', start: new Date('2014-06-19T00:00:00.000Z'),
end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0 }]
}];
public dependencies: GanttDependency[] = [
{ id: 528, fromId: 18, toId: 19, type: DependencyType.FS },
{ id: 529, fromId: 19, toId: 39, type: DependencyType.FS },
{ id: 535, fromId: 24, toId: 29, type: DependencyType.FS },
{ id: 551, fromId: 13, toId: 29, type: DependencyType.FF },
{ id: 777, fromId: 7, toId: 11, type: DependencyType.SF },
{ id: 556, fromId: 39, toId: 24, type: DependencyType.FS },
{ id: 546, fromId: 29, toId: 17, type: DependencyType.FS },
];
}
Selector
kendo-gantt
Export Name
Accessible in templates as #kendoGanttInstance="kendoGantt"
Inputs
Name | Type | Default | Description |
---|---|---|---|
activeView |
|
|
The active timeline view. |
columnMenu |
|
|
Specifies if the column menu of the columns will be displayed. |
columnsAutoSize |
|
|
Indicates whether the Gantt columns will be resized during initialization so that they fit their headers and row content. Columns with autoSize set to false are excluded. |
columnsReorderable |
|
|
If set to true, the user can reorder columns by dragging their header cells. |
columnsResizable |
|
|
If set to true, the user can resize columns by dragging the edges (resize handles) of their header cells. |
currentTimeMarker |
|
|
Specifies the Gantt current time marker settings.
The settings will be applied for all views.
If the |
data |
|
Gets or sets the data of the Gantt.
| |
dependencies |
|
Defines the dependencies that will be drawn between the rendered tasks.
| |
dependencyModelFields |
|
Sets the fields which will be used to extract the dependency data from the provided
| |
dragScrollSettings |
|
Specifies the settings for auto-scrolling during dragging when the pointer moves outside of the container bounderies see example. | |
fetchChildren |
|
Gets or sets the callback function that retrieves the child items for a particular item. | |
filter |
|
The descriptor by which the data will be filtered. | |
filterable |
|
|
Enables the filtering of the Gantt columns that have their |
hasChildren |
|
Gets or sets the callback function that indicates if a particular item has child items. | |
isExpanded |
|
Sets the callback function that indicates if a particular item is expanded. If no callback is set, all items will be expanded and no expand icons will be rendered. | |
isSelected |
|
Specifies a callback that determines if the given task is selected (see example).
| |
navigable |
|
If set to | |
rowClass |
|
Defines a function that is executed for every data row in the component. | |
selectable |
|
Enables or disables the Gantt selection mechanism (see example).
| |
sort |
|
The descriptors by which the data will be sorted. | |
sortable |
|
Enables the sorting of the Gantt columns that have their | |
taskClass |
|
Defines a function that is executed for every task in the component. The classes returned from the function are applied to the task wrapper element. | |
taskModelFields |
|
Sets the fields which will be used to extract the task data from the provided
| |
timelinePaneOptions |
|
The options of the timeline splitter pane. By default the pane is | |
toolbarAriaLabel |
|
Allows setting the toolbar(s) | |
toolbarSettings |
|
The toolbar configuration. Defines the position and content of the toolbar(s).
The available properties are The possible values for each option are:
and the second one - below the Gantt panes. Renders the respective tool in the both toolbars.
No add task or view selector tool is rendered when used for setting | |
treeListPaneOptions |
|
The options of the treelist splitter pane.
By default the pane is | |
validateNewDependency |
|
Specifies a callback that determines if a new dependency is valid. Used when evaluating if an attempt to create a new dependency will result in a valid link between the two tasks see example. By defalut, dependencies are deemed invalid when:
| |
workDayEnd |
|
The end time of the work day.
Accepts string values in the | |
workDayStart |
|
The start time of the work day.
Accepts string values in the | |
workWeekEnd |
|
The end of the work week (index based). | |
workWeekStart |
|
The start of the work week (index based). |
Fields
Name | Type | Default | Description |
---|---|---|---|
columns |
|
A query list of all declared columns. | |
taskIdField |
|
The name of the field which contains the unique identifier of the task data item. Defaults to 'id'. | |
views |
|
A query list of all declared views. |
Events
Name | Type | Description |
---|---|---|
activeViewChange |
|
Fires each time the user selects a different view type. The event data contains the type of the newly selected view. |
cancel |
|
Fires when the user cancels editing a task. |
cellClick |
|
Fires when a cell is clicked. |
cellClose |
|
Fires when the user leaves an edited cell. |
cellDblClick |
|
Fires when the user double clicks a cell. |
columnReorder |
|
Fires when the user completes the reordering of the column. |
columnResize |
|
Fires when the user completes the resizing of the column. |
columnVisibilityChange |
|
Fires when the user changes the visibility of the columns from the column menu or column chooser. |
dataStateChange |
|
Fires when the filter or sort state of the Gantt is changed. |
dependencyAdd |
|
Fires when the user adds a dependency via dragging see example. |
filterChange |
|
Fires when the Gantt filter is modified. You have to handle the event yourself and filter the data. |
remove |
|
Fires when the user confirms deleting a task. |
rowCollapse |
|
Fires when an item is collapsed. |
rowExpand |
|
Fires when an item is expanded. |
save |
|
Fires when the user saves an edited task. |
selectionChange |
|
Fires when the Gantt selection is changed through user interaction. Holds data about the affected
|
sortChange |
|
Fires when the sorting of the Gantt is changed. You have to handle the event yourself and 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 data item, associated with the clicked task, is available in the event data. Use the event handler to open a task editing dialog as necessary. |
taskDelete |
|
Fires when the end user clicks the |
timelinePaneCollapsedChange |
|
Fires when the collapsed state of the timeline pane is changed. |
timelinePaneSizeChange |
|
Fires each time the user resizes the timeline pane. |
treeListPaneCollapsedChange |
|
Fires when the collapsed state of the treelist pane is changed. |
Methods
autoFitColumn | ||||||
---|---|---|---|---|---|---|
Applies the minimum possible width for the specified column,
so that the whole text fits without wrapping. This method expects the Gantt
to be resizable (set | ||||||
|
autoFitColumns | ||||||
---|---|---|---|---|---|---|
Adjusts the width of the specified columns to fit the entire content, including headers, without wrapping.
If no columns are specified, This method requires the Gantt to be resizable (set | ||||||
|
closeCell |
---|
Closes an edited cell. |
closeTaskDialog |
---|
Closes the task editing dialog. |
editCell | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Opens a cell for editing. | ||||||||||||
|
editTask | |||||||||
---|---|---|---|---|---|---|---|---|---|
Opens the task editing dialog. | |||||||||
|
focus |
---|
Focuses the last active cell or task in the Gantt. If no item has previously been focused, the first cell of the TreeList part will receive focus, (see example). |
focusCell | |||||||||
---|---|---|---|---|---|---|---|---|---|
Focuses the targeted cell in the TreeList part of the component, (see example). | |||||||||
|
focusTask | ||||||
---|---|---|---|---|---|---|
Focuses the targeted task in the Timeline part of the component, (see example). | ||||||
|
openConfirmationDialog |
---|
Opens the delete task confirmation dialog. |
reload | |||||||||
---|---|---|---|---|---|---|---|---|---|
Clears the already loaded children for the dataItem so that the Gantt will fetch them again the next time it is rendered. | |||||||||
|
reorderColumn | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Changes the position of the specified column.
The reordering of columns operates only on the level
which is inferred by the source column.
For the | ||||||||||||
|
updateView |
---|
Forces the TreeList to evaluate if some data items have changed and re-renders the rows information, if needed. Recalculates and re-renders the Timeline period, if needed. Redraws changed dependencies, if needed. Executes all row-related callbacks anew. |