NodeOptions class (OrgChart)

NodeOptions()

new NodeOptions()

The NodeOptions structure contains options that a node of the control can handle.

Every option of the NodeOptions type has associated a property of the Node object. For instance, the option:

caption {string}, specifies the ex-HTML caption a node displays
is associated with the property:
Caption {string}, specifies the ex-HTML caption a node displays
which means that the following statements are equivalent:
oNode.Options = {caption: "name"}
oNode.SetOptions({caption: "name"})
oNode.Caption = "name"
oNode.SetCaption("name")
where oNode is an object of Node type
NodeOptions

Members

(static) align :exontrol.AlignEnum

The align field specifies the assistant/child-nodes' alignment relative to the node itself (if empty/null/missing the parent's align is considered). The exontrol.AlignEnum type supports the following values:
  • exAlignLeft (0), aligns object to the left
  • exAlignCenter (1), centers object horizontally in the rectangle
  • exAlignRight (2), aligns object to the right
.
Type:
  • exontrol.AlignEnum
align

(static) caption :string

The caption field specifies the ex-HTML caption a node displays.
Type:
  • string
caption

(static) cursor :string

The cursor field defines the mouse-cursor for an individual node.
Type:
  • string
cursor

(static) cursors :string

The cursors field defines the mouse cursor to display when pointing over a node. This property is applied to all node's descendants. The format of cursors property is:
"cursor(part),cursor(part),..."
where:
  • "cursor", defines the CSS mouse cursor to display while cursor hovers the part
  • "part", defines the name of the part the cursor is applied on (as defined bellow)
The cursors property supports any of the following parts:
  • "node" (node), indicates any node
  • "nodea" (assistant-node), indicates assistant-nodes
  • "nodeg" (group-node), indicates group-nodes
  • "expand" (expand/collapse), indicates node's expand/collapse glyphs
  • "anchor" (hyperlink), indicates the anchor-element (the <a id;options> ex-HTML part marks an anchor or hyperlink element) (@since 2.2)
  • "select" (selection), indicates selected nodes
  • "drag-drop", defines the cursor while the node is being dragged using the "drag-drop" action
.
Type:
  • string
cursors

(static) enabled :boolean

The enabled field indicates whether the node is enabled or disabled.
Type:
  • boolean
enabled

(static) expand :boolean

The expand field indicates whether the node's direct-descendants are expanded or collapsed.
Type:
  • boolean
expand

(static) expandAssistant :boolean

The expandAssistant field indicates whether the node's assistant direct-descendants are expanded or collapsed.
Type:
  • boolean
expandAssistant

(static) expandChild :boolean

The expandChild field indicates whether the node's child direct-descendants are expanded or collapsed.
Type:
  • boolean
expandChild

(static) expandGroup :boolean

The expandGroup field indicates whether the node's group direct-descendants are expanded or collapsed.
Type:
  • boolean
expandGroup

(static) flow :Layout.FlowEnum

The flow field specifies the flow and arrangement of the node and its descendant nodes (if empty/null/missing the parent's flow indicates the node's flow and arrangement).
Type:
flow

(static) formatText :exontrol.DrawTextFormatEnum

The formatText field specifies the format to display the node's caption. A combination of one or more exontrol.DrawTextFormatEnum flags that defines the format to show the node's caption. The exontrol.DrawTextFormatEnum type support the following flags:
  • exTextAlignTop (0x00), justifies the text to the top of the rectangle
  • exTextAlignLeft (0x00), aligns text to the left
  • exTextAlignCenter (0x01), centers text horizontally in the rectangle
  • exTextAlignRight (0x02), aligns text to the right
  • exTextAlignVCenter (0x04), centers text vertically
  • exTextAlignBottom (0x08), justifies the text to the bottom of the rectangle.
  • exTextAlignMask (0x0F), specifies the mask for text's alignment.
  • exTextWordBreak (0x10), breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the lpRect parameter. A carriage return-line feed sequence also breaks the line. If this is not specified, output is on one line.
  • exTextSingleLine (0x20), displays text on a single line only. Carriage returns and line feeds do not break the line.
  • exTextExpandTabs (0x40), expands tab characters. The default number of characters per tab is eight.
  • exPlainText (0x80), treats the text as plain text.
  • exTextNoClip (0x0100), draws without clipping.
  • exHTMLTextNoColors (0x0200), ignores the and tags.
  • exTextCalcRect (0x0400), determines the width and height of the text.
  • exHTMLTextNoTags (0x0800), ignores all HTML tags.
  • exTextPathEllipsis (0x4000), for displayed text, replaces characters in the middle of the string with ellipses so that the result fits in the specified rectangle. If the string contains backslash (\) characters, exTextPathEllipsis preserves as much as possible of the text after the last backslash.
  • exTextEndEllipsis (0x8000), for displayed text, if the end of a string does not fit in the rectangle, it is truncated and ellipses are added. If a word that is not at the end of the string goes beyond the limits of the rectangle, it is truncated without ellipses.
  • exTextWordEllipsis (0x040000), truncates any word that does not fit in the rectangle and adds ellipses.
.
Type:
  • exontrol.DrawTextFormatEnum
formatText

(static) image :string

The image field specifies the name of the image/picture the node displays. The image can be added using the exontrol.HTMLPicture.Add() method.
Type:
  • string
image

(static) imageAlign :number

The imageAlign field defines the alignment of the image within the node. The imageAlign propery can be any of the following:
  • 0, the image is on the left of the node's caption
  • 1, the image is on the right of the node's caption
  • 2, the image is on the top of the node's caption
  • 3, the image is on the bottom of the node's caption
.
Type:
  • number
imageAlign

(static) imageSize

The imageSize field defines the size of the node's image. The imageSize field can be any of the following:
  • {undefined}, Indicates that the control's imageSize option is considered, so the node's image is measured according to the control's imageSize option.
  • {null}, Indicates that the node's image is displayed as it is (full-sized).
  • {number}, Specifies that the node's image is displayed into a square of giving size (same width and height). If 0 the node displays no image, if negative the node's image is stretched to giving square, else the node's picture is scaled to fit the giving rectangle.
  • {number[]}, Specifies an array of [aspect-width,aspect-height] type that defines the limits for width or/and height. The aspect-width and aspect-height define the width/height of the node's picture to scale or stretch to.
.
imageSize

(static) key :string

The key field specifies the key associated with the node. Specifies the key associated with the node. You can use the Node() method ro request a node giving its key or caption.
Type:
  • string
key
The link field specifies the attributes of the link between a node and its descendant nodes.
Type:
link

(static) linka :DisplayLinkType

The linka field specifies the attributes of the link between a node and its assistent-nodes.
Type:
linka

(static) linkg :DisplayLinkType

The linkg field specifies the attributes of the link between a node and its group-nodes.
Type:
linkg

(static) margins :object

The margins field specifies the horizontal and vertical distance between nodes. Indicates an object of {x,y,indent,border} type that horizontal, vertical and indent distance between nodes.
Type:
  • object
margins

(static) pad :number|Array.<number>|string

The pad field defines the node's padding (space between the node's content and its border). The pad field can be:
  • {number} a numeric value, to pad horizontal and vertical size with the same value
  • {number[]|string} a "x,y" or [x,y] type to specify the padding on h/v size
.
Type:
  • number | Array.<number> | string
pad

(static) selectable :boolean

The selectable field indicates whether the user can select the node.
Type:
  • boolean
Example
false {boolean}, the user can't select the node
 true {boolean}, the user can select the node
selectable

(static) shape :any

The shape field defines the shape for an individual node as:
  • {string} a string expression that defines the shape for the element itself
  • {object} an object of {normal, hover, click, disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
.
Type:
  • any
shape

(static) shapes :string

The shapes field defines the shapes for the node including its descendants. The format of shapes property is:
"shape(part),shape(part),..."
where:
  • "shape", defines the shape to apply on the UI part as one of the following:

    ◦ any of 140 color names any browser supports (such as red, blue, green, ...)
    ◦ hexadecimal colors, is specified with: #RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal integers specify the components of the color. All values must be between 00 and FF (such as #0000ff which defines a blue background)
    ◦ hexadecimal colors with transparency, is specified with: #RRGGBBAA, where AA (alpha) value must be between 00 and FF (such as #0000ff80 which defines a semi-transparent blue background)
    ◦ RGB colors, is specified with the RGB(red, green, blue) function. Each parameter (red, green, and blue) defines the intensity of the color and can be an integer between 0 and 255( such as rgb(0,0,255) that defines a blue background)
    ◦ RGBA colors, are an extension of RGB color values with an alpha channel as RGBA(red, green, blue, alpha) function, where the alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque) ( such as rgba(0,0,255,0.5) which defines a semi-transparent blue background)
    ◦ HSL colors, is specified with the HSL(hue, saturation, lightness) function, where hue is a degree on the color wheel (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue. saturation is a percentage value; 0% means a shade of gray and 100% is the full color. lightness is also a percentage; 0% is black, 100% is white. HSL stands for hue, saturation, and lightness - and represents a cylindrical-coordinate representation of colors (such as hsl(240, 100%, 50%) that defines a blue background)
    ◦ HSLA colors, are an extension of HSL color values with an alpha channel - which specifies the opacity of the object as HSLA(hue, saturation, lightness, alpha) function, where alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque) (such as hsla(240, 100%, 50%,0.5) that defines a semi-transparent blue background)
    ◦ a JSON representation of the shape object to apply (while it starts with { character, such as '{"normal": {"primitive": "RoundRect","fillColor":"black","tfi": {"fgColor": "white"}}}')
    ◦ specifies the name of the field within the exontrol.Shapes.OrgChart object (while it starts with a lowercase letter, such as dfnode which refers to exontrol.Shapes.OrgChart.dfnode shape)
    ◦ specifies the name of the field within the exontrol.Shapes object (while it starts with an uppercase letter, such as Button which refers to exontrol.Shapes.Button shape)

  • "part", defines the name of the part the shape is applied on (as defined bellow)
The shapes property supports any of the following parts:
  • "node" (node), defines the visual appearance for any node
  • "nodea" (assistant-node), defines the visual appearance for assistant-nodes
  • "nodeg" (group-node), defines the visual appearance for group-nodes
  • "expand", specifies the visual appearance for expand/collapse glyphs
  • "select" (selection), defines the visual appearance for selected nodes
  • "frameFit", defines the visual-appearance to display the frame while fitting nodes into the control's client area by drag
  • "frameSel", defines the visual appearance to display a frame while selecting nodes by drag
  • "frameDrag", specifies the visual appearance to display a frame while dragging the nodes
  • "multiSel", specifies the visual appearance to show the count of multiple-selected items
.
Type:
  • string
Example
null {null}, specifies the default visual appearance
 "" {string}, no shape (no visual appearance is applied to any part of the control)
 "red(node)", "#FF0000(node)", "rgb(255,0,0)(node)", "rgba(255,0,0,1)(node)" {string}, shows all-nodes in red
 '{"hover":{"frameColor":"black","pad":-0.5}}(node)' {string}, draws a black-frame arround the node being hovered
 "xxx(d),yyy(d,m),zzz(y)"  {string}, specifies that the exontrol.Shapes.OrgChart.xxx combined with exontrol.Shapes.OrgChart.yyy object defines the visual appearance of "d" part of the control, exontrol.Shapes.OrgChart.yyy object defines the visual appearance of "m" part of the control and exontrol.Shapes.OrgChart.zzz object defines the visual appearance of "y" part of the control
shapes

(static) show :NodeTypeEnum

The show field specifies the type(s) of direct descendant-nodes the current node shows. Shortly, it can show or hides assistant/child or group-nodes of the current node (not recursivelly). For instance, you can hide the node's assistant-nodes if excludes the NodeTypeEnum.exNodeAssistant flag (indicates null (no effect), one or a combination of more flags of NodeTypeEnum type that defines the type of nodes the current node displays). The NodeTypeEnum defines the following flags (type of nodes):
  • exNodeChild (1), specifies a node of child-type
  • exNodeAssistant (2), specifies a node of assistant-type
  • exNodeGroup (4), specifies a node of group-type
.
Type:
show

(static) showExpandGlyphs :NodeTypeEnum

The showExpandGlyphs field specifies whether the node's expand/collapse glyphs is shown for different type of nodes (indicates null (no effect), one or a combination of more flags of NodeTypeEnum type that determines the type of nodes for who the expand/collapse glyphs are visible). The NodeTypeEnum defines the following flags (type of nodes):
  • exNodeChild (1), specifies a node of child-type
  • exNodeAssistant (2), specifies a node of assistant-type
  • exNodeGroup (4), specifies a node of group-type
.
Type:
showExpandGlyphs

(static) singleExpandGlyphs :boolean

The singleExpandGlyphs field specifies whether the node displays a single or multiple expand/collapse glyphs (indicates null (no effect), or a boolean expression that specifies whether the node displays a single or multiple expand/collapse glyphs).
Type:
  • boolean
singleExpandGlyphs

(static) size

The size field defines the size or limits of the node's caption. The size field can be any of the following:
  • {undefined}, Indicates that the control's size option is considered, so the node's caption is measured according to the control's size option
  • {null}, Indicates that no limit for the node's caption
  • {number}, Specifies that the node's caption is displayed into a square of giving size (same width and height ). If 0 the node displays no caption
  • {number[]}, Specifies an array of [min-width,min-height,max-width,max-height] type that defines the limits for width or/and height of the measured caption. The min-width,min-height,max-width,max-height can be null which indicates that the limit is ignored, or a positive number that specifies the limit (min or max)
.
size

(static) visible :boolean

The visible field indicates whether the current node (and all its descendants node) is visible or hidden.

Every option of the NodeOptions type has associated a property of the Node object. For instance, the option:

caption {string}, specifies the ex-HTML caption a node displays
is associated with the property:
Caption {string}, specifies the ex-HTML caption a node displays
which means that the following statements are equivalent:
oNode.Options = {caption: "name"}
oNode.SetOptions({caption: "name"})
oNode.Caption = "name"
oNode.SetCaption("name")
where oNode is an object of Node type
.
Type:
  • boolean
visible