TreeGrid v6.6

Interactive Gantt chart

TreeGrid documentation index

 

The Gantt chart is interactive, every setting can be also changed by mouse inside the Gantt chart. What can be changed by a user is controlled by GanttEdit.

All the mouse controlling actions can be fully customized in <Actions/> tag, you can specify what mouse event will provide which action. Also for every row can be specified what can be changed by a user (main task bar, milestone, flow bars, run bars, flags, dependencies, resources).

New main (task) bar, flow bars and run bars are created by mouse dragging on empty Gantt space. The flow bar is created when the main bar already exists. 

New milestone is created by double click or from popup menu when neither milestone nor main bar exists. 

New flag is created by double click anywhere except the main bar or milestone or from popup menu. 
Main bar, flow bars and run bars are resized by dragging their edges. 

Main bar, flow bars, run bars, milestone and flags are moved by mouse dragging. 

Run bars can be copied or moved between rows or grids by mouse dragging, according to the Run settings.

Main bar, flow bars are deleted by resizing their width to zero or by ctrl + click or from popup menu. 

Run bars are deleted by resizing their width to zero or from popup menu. 

Milestone and flags are deleted by ctrl + click or from popup menu. 
Resources are changed by double click to main bar or milestone or from popup menu. 

Flag text is changed by double click to the flag or from popup menu. 

The percent completed is set by ctrl + right click to main bar or from popup menu. 
New dependencies are created by dragging from starting to ending main bar or milestone. Dragging left half of main bar creates 's' and right half 'f' dependency type. 

Dependencies are deleted by ctrl + click to the ending or starting point next to main bar (the ending dependencies are deleted first) or by deleting main bar or from popup menu.
On the right click is displayed the 
popup menu with the mentioned options. The options set is dependent on what is clicked.
Every change can be undone by Ctrl+Z or redone by Ctrl+Y (the grid must be focused) and have set <Cfg Undo=’1’/>.
The Gantt chart actions are attached to events in
<Actions/> tag. The default settings see in <Actions/> tag in Defaults.xml file.

 

Edit settings

 

<C><cell>        string[] GanttEdit            [“all”]                                                                               renamed 6.0 upd 6.4       .

Which parts can be edited / moved / changed by user. Comma separated list of flag names, case insensitive.

All                          All Gantt items are editable / movable

Main                     Main bars and milestones can be created, deleted and modified directly in Gantt chart

Flow                      Flow bars can be created, deleted and modified directly in Gantt chart

Run                        Run bars can be created, deleted and modified directly in Gantt chart

Flags                     Flags can be created, deleted, moved and modified directly in Gantt chart

Points                    (new 6.4) Points can be created, deleted, moved and modified directly in Gantt chart

Constraints          (new 6.3) Constraints can be created, deleted and moved directly in Gantt chart

Dependency         Dependency lines can be created and deleted directly in Gantt chart

DependencyTypes             (new 6.3) Dependency type can be set by dragging to different bar edge (ss,sf,fs,ff)

DependencyLags               (new 6.3) Dependency lag can be changed

Resources            Resources can be assigned or entered directly in Gantt chart

 

<C>                  bool      GanttAdding   [1]                                                                                                       new 6.4       .

If new Gantt objects can be added to the chart

 

<C>                  bool      GanttDeleting [1]                                                                                                       new 6.4       .

If Gantt objects can be deleted from the chart

 

<C>                  int        GanttResizeDelete            [1]                                                                               new 6.1       .

If the Main, Flow and Run bars can be deleted by resizing them to zero width.

0 – no, 1 – yes, 2 – show confirm message

 

<C>                  int        GanttCheck      [2]                                                                                                      new 6.3       .

Check if Gantt source cell change by a user edit is correct.

0 – no, 1 restrict incorrect changes, 2 – alert warning and restrict incorrect changes

It check circular dependencies, percentage complete, negative duration, End>Start

 

<C>                  bool      GanttEditStartMove          [1]                                                                               new 6.5       .

If set to 0, editing start resizes the task (preserves end and changes duration)

If set to 1, editing start moves the task (changes end and preserves duration)

 

<C><cell>        int        GanttHover       [1]                                                                                              renamed 6.0            .

If the Gantt items under mouse cursor will be highlighted.

0 – never, 1 – only when it is editable / movable, 2 – always

 

Dragging actions

 

<Actions>                    DragGantt          Attached to OnDragGantt event, cannot be attached elsewhere                         .

Universal action for dragging in Gantt chart. Changes Gantt chart content by mouse dragging. It can be used only for OnDragGantt event.

When mouse is above bar edge, it resizes the bar horizontally. When the bar is resized to width 0, it is deleted (if set GanttResizeDelete). The Flow bar edge has precedence to Main bar.

When mouse is above bar but not above its edge, it moves the bar horizontally.

The Flow bar edge has precedence to Main bar and milestone. The flag has precedence to Flow bar.

When moving Main bar and creating dependencies is permitted, mouse must be always above the actual row, otherwise dependency is being created.

When mouse is above empty place, it creates and resizes new Main bar. If the Main bar already exists in the row, it creates and resizes new Flow bar.

When mouse is above milestone or flag, it moves the milestone or flag to the new position in the same row.

When mouse is above Main bar but not above its edge and dragging is done to another row, it connects dependency line with another Main bar.

                Connects always from the first bar to the second bar. When dependency types (ss,sf,fs,ff) are permitted, the left half of bar specifies ‘s’, the right ‘f’.

You can specify <Actions OnDragGantt=’DragGantt’/> to provide all Gantt dragging to single drag or you can specify individual drag actions separately like:

<Actions OnDragGantt="DragGanttResize OR DragGanttFlag" CtrlDragGantt="DragGanttNew" ShiftDragGantt="DragGanttDependency"/>

 

<Actions>                    DragGanttResize                Not attached to any event, can be attached to OnDragGantt only      .

Resizing bar action from DragGantt. It can be used only for OnDragGantt event.

When mouse is above bar edge, it resizes the bar horizontally. When the bar is resized to width 0, it is deleted. The Flow bar edge has precedence to Main bar.

 

<Actions>                    DragGanttNew          Not attached to any event, can be attached to OnDragGantt only            .

Creating new bar action from DragGantt. It can be used only for OnDragGantt event.

Creates and resizes new Main bar. If the Main bar already exists in the row, it creates and resizes new Flow bar.

 

<Actions>                    DragGanttMove        Not attached to any event, can be attached to OnDragGantt only            .

Moving bar, milestone or flag action from DragGantt. It can be used only for OnDragGantt event.

When mouse is above bar, milestone or flag, it moves the bar, milestone or flag to the new position in the same row.

 

<Actions>                    DragGanttDependency              Not attached to any event, can be attached to OnDragGantt only        .

Connects Gantt chart row with another row by dependency line, by mouse dragging. It can be used only for OnDragGantt event.

Connects always from the first Main bar to the second Main bar. 

When dependency types (ss,sf,fs,ff) are permitted, the left half of bar and the left side specifies ‘s’, the right half of bar and right side specifies ‘f’.

 

Deleting actions

 

<Actions>                    DeleteGanttConstraint   Attached to OnCtrlClickGantt event                              new 6.3       .

Deletes the constraint under mouse cursor

It fails if there is no constraint under mouse cursor.

 

<Actions>                    DeleteGanttConstraints           Not attached to any event                                 new 6.3       .

Deletes all constraint in the actual row

It fails if there is no constraint in the row.

 

<Actions>                    DeleteGanttFlag                  Attached to OnCtrlClickGantt event                                         .

Deletes one flag under mouse cursor.

It fails if there is no flag under mouse cursor

 

<Actions>                    DeleteGanttPoint                Attached to OnCtrlClickGantt event                             new 6.4       .

Deletes the point under mouse cursor.

It fails if there is no point under mouse cursor

 

<Actions>                    DeleteGanttRun                   Not attached to any event                                             new 6.1       .

Deletes one Row box under mouse cursor

It fails if there is no Run box under mouse cursor.

 

<Actions>                    DeleteGanttFlow                 Attached to OnCtrlClickGantt event                                          .

Deletes one Flow bar under mouse cursor

It fails if there is no Flow under mouse cursor.

 

<Actions>                    DeleteGanttMain                 Attached to OnCtrlClickGantt event                                          .

Deletes Main bar if it is under mouse cursor

It fails if there is not Main bar under mouse cursor.

 

<Actions>                    DeleteGanttDependency         Attached to OnCtrlClickGantt event                             .

Deletes one dependency line ending under mouse cursor. The dependency is under mouse cursor only next to the Main bar.

If there are more dependencies under mouse cursor, first are deleted incoming dependencies and if no incoming dependency under mouse cursor, the outcoming dependencies are deleted. Other order is not specified.

It fails if there is no dependency ending (start or end) is under mouse cursor

 

<Actions>                    DeleteGanttDependencies ...F       Attached to OnCtrlClickGantt event                  .

Deletes all incoming and outcoming dependencies from actual or focused Gantt cell.

It fails if there is no dependency from and to the Gantt cell.

 

<Actions>                    DeleteGanttAll ...F             Not attached to any event                                                        .

Deletes all Gantt items from the actual or focused Gantt cell, including all dependencies.

 

<Actions>                    DeleteGanttBase                Attached to OnCtrlClickGantt event                             new 6.6       .

Deletes or undeletes GanttBase when clicked above the line.

Undelete means setting it to automatically calculated value.

 

<Actions>                    DeleteGanttFinish             Attached to OnCtrlClickGantt event                             new 6.6       .

Deletes or undeletes GanttFinish when clicked above the line.

Undelete means setting it to automatically calculated value.

 

Changing actions

 

<Actions>                    SetGanttPercent                 Attached to OnCtrlRightClickGantt event                                 .

Changes % of completed to position under mouse cursor.

It fails if mouse is not above Main bar.

 

<Actions>                    EditGanttResource           Attached to OnDblClickGantt event                                          .

Lets a user to edit resource text of main bar or milestone under mouse cursor.

 

<Actions>                    EditGanttText                        Attached to OnDblClickGantt event                             new 6.0       .

Lets a user to edit tooltip text of main bar or milestone under mouse cursor.

 

<Actions>                    EditGanttFlowText            Attached to OnDblClickGantt event                             new 6.0       .

Lets a user to edit tooltip text of real flow bar under mouse cursor.

 

<Actions>                    EditGanttRun                         Attached to OnDblClickGantt event                             new 6.1       .

Lets a user to edit text shown on the run box under mouse cursor.

 

<Actions>                    EditGanttRunTip                 Not attached to any event                                            new 6.1       .

Lets a user to edit text shown as tooltip for the run box under mouse cursor.

 

<Actions>                    ChooseGanttRunType   Not attached to any event                                             new 6.1       .

Lets a user to choose type of the run under mouse cursor. The possible run types are defined by GanttRunTypes.

 

<Actions>                    EditGanttFlag             Attached to OnDblClickGantt event                                                     .

Lets a user to edit text of flag under mouse cursor.

It fails if there is not flag under mouse cursor.

 

<Actions>                    ChooseGanttFlagIcon    Not attached to any event                                             new 6.1       .

Lets a user to choose icon of the flag under mouse cursor. The possible icons are defined by GanttFlagIconList and GanttFlagIconNames.

 

<Actions>                    EditGanttDependencyLag                  Attached to OnDblClickGantt event      new 6.0       .

Lets a user to edit value of dependency lag. A user must click to start of dependency near to (but not to) main bar.

By default is the action attached to event OnDblClickGantt (double click to Gantt cell).

It fails if there is no dependency start under mouse cursor.

 

<Actions>                    NewGanttMilestone         Attached to OnDblClickGantt event                                         .

Adds new milestone on mouse position, only when the cell has neither main bar nor milestone

It fails if there is already milestone or main bar in the cell.

 

<Actions>                    NewGanttFlag           Attached to OnDblClickGantt event                                                     .

Adds new flag on mouse position and lets a user edit its text.

 

<Actions>                    NewGanttPoint         Attached to OnDblClickGantt event                                         new 6.4       .

Adds new point on mouse position.

 

<Actions>                    NewGanttConstraint        Not attached to any event                                             new 6.3       .

Adds new constraint on mouse position.

 

Popup menu

By default is the Gantt menu shown on right click on the Gant item.

It contains menu items available for the click location, for the clicked Gantt item.

It is possible to add new menu items by Menu attribute.

 

<Actions>                    GanttMenu     Attached to OnRightClickGantt event                                                              .

Shows popup menu with available actions for given clicked point in the Gantt cell.

 

<C> <cell>       string [*] Menu                                                                                                                              chg 6.0       .

Context (popup) menu for the Gantt cell to add custom items to the default Gantt menu.

This popup menu is displayed when user right clicks to cell. After user selects the custom menu item, the OnContextMenu event is called.

It can be first character separated array of menu item names. They can contain any HTML code. Separator can be shown as item named ‘-‘

Or it can be in standard TreeGrid menu format as complex menu with sub levels, sub menus, columns and so on.

See also API ShowMenu function to show custom menu from JavaScript.

To hide some default menu item set its text in <Lang><Gantt></Lang> to empty string.

The predefined menu item texts are defined in Text.xml, in <Lang><Gantt></Lang>:

DelGanttDepStart="Disconnect line to &lt;b style='color:#00AA00;'> %d&lt;/b>"

DelGanttDepEnd="Disconnect line from &lt;b style='color:blue;'> %d&lt;/b>"

DelAllGanttDep="Disconnect all dependency lines"

DelGanttMainDep="Delete main bar and dependencies"

DelGanttMain="Delete main bar"

DelGanttMilestoneDep="Delete milestone and dependencies"

DelGanttMilestone="Delete milestone"

SetGanttPercent="Update completed status to selected point"

EditGanttPercent="Enter completed status"

DelGanttFlow="Delete real flow"

DelGanttFlowPart="Delete selected real flow bar"

DelGanttFlags="Delete all flags"

DelGanttFlag="Delete selected flag"

EditGanttFlag="Enter the flag text"

ChooseGanttFlagIcon="Select the flag icon"

DelGanttAll="Clear the gantt cell"

NewGanttFlag="Add new flag to selected point"

EditGanttResource="Change resources"

AssignGanttResource="Assign resources"

CorrectAllDependencies="Correct all dependencies in chart"

CorrectRelatedDependencies="Correct related dependencies"

EditGanttText="Enter the main bar information"

EditGanttFlowText="Enter the real flow information"

DelGanttRun="Delete all the boxes"

DelGanttRunPart="Delete the box"

EditGanttRun="Change the box text"

EditGanttRunTip="Change the box information"

ChooseGanttRunType="Select the box type"

 

API event         bool      OnGanttMenu            (TGrid grid, TRow row, string col, TMenu Menu, object GanttXY)            new 6.1 .

Called before the Gantt popup menu is displayed for the appropriate cell.

Menu is TreeGrid JavaScript TMenu object, here can be changed, items modified, added or deleted and so on.

GanttXY is object returned by GetGanttXY method and contains information about the Gantt bar(s) under mouse cursor.

Return true to cancel showing menu.

 

API event         bool      OnContextMenu      (TGrid grid, TRow row, string col, string result)                        chg 6.0       .

Called when a user clicks to custom item in Gantt context menu set by Menu attribute.

result is Value or Name of the clicked item or all value.

Return true to not close the menu.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.