new LinkOptions()
Every option of the LinkOptions type has associated a property of the Link object. For instance, the option:
caption {string}, defines the link's captionis associated with the property:
Caption {string}, defines the link's captionwhich means that the following statements are equivalent:
oLink.Options = {caption: "link"}where oLink is an object of Link type
oLink.SetOptions({caption: "link"})
oLink.Caption = "link"
oLink.SetCaption("link")
Members
(static) caption :string
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
"<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
caption
(static) from :number|string|ItemBar
- {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:
- number | string | ItemBar
(static) key :string
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 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
(static) link :DisplayLinkType
- 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
- {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:
- number | string | ItemBar
(static) type :any
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
- 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))
- "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 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 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