JavaScript

Drag and drop link creating is enabled by default (linkCreateHandling="Update").

html5-gantt-link-creating-hover.png

The linking points are activated on task hover. You can create a new link using drag and drop.

html5-gantt-link-creating.png

In addition to the default action specified by linkCreateHandling, two events are fired:

  • onLinkCreate (before the default action)
  • onLinkCreated (after the default action)

You can add a new link using links.add() method.

Example

Drag and drop link creating handler.

gantt.onLinkCreated = function(args) {
  gantt.message("Created");
};

Adding a new link using JavaScript

gantt.links.add({
  from: "1",
  to: "2",
  type: "FinishToStart"
});