Class: LinkOptions

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.
Type:
  • string
Example
null {null}, indicates no caption
 "caption" {string}, declares a plain-caption
 "<b>text</b>" {string}, displays the text in bold
 "<img>logo</img>" {string}, displays the "logo" image. The image can be added using the exontrol.HTMLPicture.Add() method

(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:
  • from {number}, indicates a numeric value that defines the index of the item (single/first item-bar of the item)
  • from {string}, specifies a string expression that defines the identifier/key of the item (single/first item-bar of the item)
  • from {ItemBar}, specifies the object reference to the item-bar
Type:

(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
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.

(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.
Type:
  • number
Example
null {null}, no lag between linked-activities
 2 {number}, indicates 2 days between linked-activities
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
Type:
Example
The following sample defines "straight" links shown in gray:
{
   type: 2,
   color: "gray"
}

(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:
  • to {number}, indicates a numeric value that defines the index of the item (single/first item-bar of the item)
  • to {string}, specifies a string expression that defines the identifier/key of the item (single/first item-bar of the item)
  • to {ItemBar}, specifies the object reference to the item-bar
Type:

(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.

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)
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))

(static) visible :boolean

The visible field indicates whether the link is visible or hidden.
Type:
  • boolean
Example
false {boolean}, hides the link
 true {boolean}, shows the link

(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.
Type:
  • number
Example
null {null}, no lag between linked-activities
 2 {number}, indicates 2 working-days between linked-activities