LinkOptions class (Gantt)

LinkOptions()

new LinkOptions()

The LinkOptions class holds all options a Link can display or own. The Item(id) gets the link giving its index, identifier/key or reference.

Every option of the LinkOptions type has associated a property of the Link object. For instance, the option:

caption {string}, defines the link's caption
is associated with the property:
Caption {string}, defines the link's caption
which means that the following statements are equivalent:
oLink.Options = {caption: "link"}
oLink.SetOptions({caption: "link"})
oLink.Caption = "link"
oLink.SetCaption("link")
where oLink is an object of Link type

Members

(static) caption :string

The caption field defines the link's caption. The caption can include ex-HTML tags, such as <b>, <fgcolor> and so on. If no key is provided, the link's plain-caption can be used to request an item. The plain-caption includes no ex-HTML tags, such as <b>, <fgcolor> and so on. The Gantt.Link() method gets the link giving its index, identifier/key or reference. You can display images using the <img> tag in the caption, where the image can be added using the exontrol.HTMLPicture.Add method.

The caption field is mapped to the Link.Caption property, so the following statements are equivalent:

oLink.Options = {caption: "<b>link</b>"}
oLink.SetOptions({caption: "<b>link</b>"})
oLink.Caption = "<b>link</b>"
oLink.SetCaption("<b>link</b>")
Type:
  • string
Example
null {null}, indicates no caption
"caption" {string}, declares a plain-caption
"&lt;b&gt;text&lt;/b&gt;" {string}, displays the text in bold
"&lt;img&gt;logo&lt;/img&gt;" {string}, displays the "logo" image. The image can be added using the exontrol.HTMLPicture.Add method
caption

(static) from :number|string|ItemBar

The from field indicates the index, identifier/key of the item that hosts the bar, or reference of the item-bar the link starts from (in-item-bar), as one of the following:
  • {number}, indicates a numeric value that defines the index of the item (single/first item-bar of the item)
  • {string}, specifies a string expression that defines the identifier/key of the item (single/first item-bar of the item)
  • {ItemBar}, specifies the object reference to the item-bar

The from field is mapped to the Link.From property, so the following statements are equivalent:

oLink.Options = {from: 2}
oLink.SetOptions({from: 2})
oLink.From = 2
oLink.SetFrom(2)

The to field indicates the index, identifier/key of the item that hosts the bar, or reference of the item-bar the link ends to (out-item-bar)

Type:
from

(static) key :string

The key field specifies the key associated with the link. If no key is provided, the link's plain-caption can be used to request an item. The plain-caption includes no ex-HTML tags, such as <b>, <fgcolor> and so on. The Gantt.Link() method gets the link giving its index, identifier/key or reference.

The key field is mapped to the Link.Key property, so the following statements are equivalent:

oLink.Options = {key: "logo"}
oLink.SetOptions({key: "logo"})
oLink.Key = "logo"
oLink.SetKey("logo")
Type:
  • string
Example
"logo" {string}, defines the link with the giving key (logo). You can use the oGantt.Chart.Links.Item("logo") method to request the link giving its key.
key

(static) lag :number

The lag field specifies the delay between linked-activities during the Items.SchedulePDM() method (exLinkPDMDelay). This property specifies the number of days between two linked bars. The SchedulePDM() method does not ignore the link even if it is hidden. The lag can be positive, negative or zero. A positive lag indicates that the successor activity starts after a delay from the predecessor activity. A negative lag indicates that the successor activity starts before the predecessor activity finishes, creating an overlap between the two activities. A zero lag indicates that there is no delay between the predecessor and successor activities.

The lag field is mapped to the Link.Lag property, so the following statements are equivalent:

oLink.Options = {lag: 2}
oLink.SetOptions({lag: 2})
oLink.Lag = 2
oLink.SetLag(2)
Type:
  • number
Example
null {null}, no lag between linked-activities
2 {number}, indicates 2 days between linked-activities
lag
The link field specifies the appearance of the link between item-bars, as an object of {type, dir, width, color, arrow, style, startPos, endPos} type, where:
  • type {exontrol.LinkTypeEnum}, specifies the type of the link as 0 (rectangular), 1 (direct), 2(straight) or 3(round)
  • dir {number}, specifies whether the link's direction is shown or hidden as 0 (hidden), 1(shows the direction/arrow where the link begins), 2(shows the direction where the link ends, default) or 3 shows the arrows in both sides
  • width {number}, specifies the link's width or size (1 by default)
  • color {string}, indicates the link's color (partial-black by default)
  • arrow {string}, indicates the arrow's color. If it is missing or not specified the arrow is shown using the link's color (gray by default)
  • arrowSize {number}, indicates the arrow's size. If it is missing or not specified the arrow's size is defined by link's width (1 by default) (since 2.2)
  • arrowShape {object}, defines an object of exontrol.Def.Shape type to customize the shape of the link's arrow (for instance shows the link's arrow as a circle instead of a triangle) (since 2.2)
  • style {array}, specifies the link's dash pattern to show the lines (solid by default)
  • startPos {any}, indicates the list of corners of in-element, the link can start from
  • endPos {any}, indicates the list of corners of out-element, the link can end to

The link field is mapped to the Link.Link property, so the following statements are equivalent:

oLink.Options = {link: {type: 2, color: "gray"}}
oLink.SetOptions({link: {type: 2, color: "gray"}})
oLink.Link = {type: 2, color: "gray"}
oLink.SetLink({type: 2, color: "gray"})
Type:
Example
The following sample defines "straight" links shown in gray:
{
   type: 2,
   color: "gray"
}
link

(static) to :number|string|ItemBar

The to field indicates the index, identifier/key of the item that hosts the bar, or reference of the item-bar the link ends to (out-item-bar), as one of the following:
  • {number}, indicates a numeric value that defines the index of the item (single/first item-bar of the item)
  • {string}, specifies a string expression that defines the identifier/key of the item (single/first item-bar of the item)
  • {ItemBar}, specifies the object reference to the item-bar
Type:
to

(static) type :any

The type field defines the link's type as 1(Start-Finish), 2(FS or Finish-Start), 4(Finish-Finish) or 8 (Start-Start). Tasks may have multiple predecessors or multiple successors. The SchedulePDM() method arranges the activities on the plan based on the links / relationships / dependencies.

Before you begin establishing dependencies, it's important to understand that there are four types:

  • Finish to Start (FS), the predecessor ends before the successor can begin
  • Start to Start (SS), the predecessor begins before the successor can begin
  • Finish to Finish (FF), the predecessor ends before the successor can end
  • Start to Finish (SF), the predecessor begins before the successor can end
The type supports the following values:
  • 1 {number} indicates a SF link (SF, S(tart)-F(inish))
  • 2 {number} indicates a FS link (FS, F(inish)-S(tart), default)
  • 4 {number} indicates a FF link (FF, F(inish)-F(inish))
  • 8 {number} indicates a SS link (SS, S(tart)-S(tart))
or
  • "SF" {string} indicates a SF link (SF, S(tart)-F(inish)) (the startPos is set on left, endPos is set on right, the Type returns 1)
  • "FS" {string} indicates a FS link (FS, F(inish)-S(tart)) (the startPos is set on right, endPos is set on left, the Type returns 2)
  • "FF" {string} indicates a FF link (FF, F(inish)-F(inish)) (the startPos is set on right, endPos is set on right, the Type returns 4)
  • "SS" {string} indicates a SS link (SS, S(tart)-S(tart)) (the startPos is set on left, endPos is set on left, the Type returns 8)

The type field is mapped to the Link.Type property, so the following statements are equivalent:

oLink.Options = {type: 2}
oLink.SetOptions({type: 2})
oLink.Type = 2
oLink.SetType(2)
Type:
  • any
Since:
  • 2.3
Example
2 or any other value except 1, 4 or 8 {number}, indicates a FS link (FS, F(inish)-S(tart))
4 {number}, indicates a FF link (FF, F(inish)-F(inish))
"SS" {string}, indicates a SS link (SS, S(tart)-S(tart))
type

(static) visible :boolean

The visible field indicates whether the link is visible or hidden. The caption field defines the link's caption. The lag field specifies the delay between linked-activities during the SchedulePDM() method. The SchedulePDM() method doe snot ignore the link even if it is hidden. By default, the visible property is set to true, meaning that the link is visible. If you set it to false, the link will be hidden, but it will still be considered in scheduling calculations and other operations that involve links.

The visible field is mapped to the Link.Visible property, so the following statements are equivalent:

oLink.Options = {visible: false}
oLink.SetOptions({visible: false})
oLink.Visible = false
oLink.SetVisible(false)
Type:
  • boolean
Example
false {boolean}, hides the link
true {boolean}, shows the link
visible

(static) workingLag :number

The workingLag field specifies the working-delay between linked-activities during the Items.SchedulePDM() method (exLinkPDMWorkingDelay). This property specifies the number of working-days between two linked bars.

The workingLag field is mapped to the Link.WorkingLag property, so the following statements are equivalent:

oLink.Options = {workingLag: 2}
oLink.SetOptions({workingLag: 2})
oLink.WorkingLag = 2
oLink.SetWorkingLag(2)

Currently, the working-lag is not supported.

Type:
  • number
Example
null {null}, no lag between linked-activities
2 {number}, indicates 2 working-days between linked-activities
workingLag