Class: Node

CV.Node(oChartView, oParent, nType)

new Node(oChartView, oParent, nType)

Creates a node of specified type that's a child of the giving parent which should display the specified information

Every option of the CV.NodeOptions type has associated a property of the CV.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 CV.Node type
Parameters:
Name Type Description
oChartView CV Specifies a reference to an object of CV type
oParent CV.Node Indicates an object of CV.Node type that specifies the parent of the current node
nType CV.NodeTypeEnum Indicates the type of the current node (by default it is a direct-child)

Methods

AddAssistant(oOptsopt) → {CV.Node}

The AddAssistant() method adds an assistant-node.
Parameters:
Name Type Attributes Description
oOpts CV.NodeOptions <optional>
Specifies an object of CV.NodeOptions type that holds information about the node, such as caption, image and so on. If the oOpts parameter is not-of object type it indicates the node's caption instead
Returns:
Returns the assistant-node as an object of CV.Node type
Type
CV.Node

AddChild(oOptsopt) → {CV.Node}

The AddChild() method adds a child-node.
Parameters:
Name Type Attributes Description
oOpts CV.NodeOptions <optional>
Specifies an object of CV.NodeOptions type that holds information about the node, such as caption, image and so on. If the oOpts parameter is not-of object type it indicates the node's caption instead
Returns:
Returns the child-node as an object of CV.Node type
Type
CV.Node

AddGroup(oOptsopt) → {CV.Node}

The AddGroup() method adds a group-node.
Parameters:
Name Type Attributes Description
oOpts CV.NodeOptions <optional>
Specifies an object of CV.NodeOptions type that holds information about the node, such as caption, image and so on. If the oOpts parameter is not-of object type it indicates the node's caption instead
Returns:
Returns the group-node as an object of CV.Node type
Type
CV.Node

Clear()

The Clear() method clears the node's descendants which includes child, assistant or group-nodes.

ClearAssistant()

The ClearAssistant() method clears the node's assistant-descendants.

ClearChild()

The ClearChild() method clears the node's child-descendants.

ClearGroup()

The ClearGroup() method clears the node's group-descendants.

Debug() → {string}

The Debug() method gets debug information about the current object
Returns:
Returns string information about the current object
Type
string

forEach(callBack, thisArg)

The forEach() method enumerates all descendant nodes of the current node (including the node itself)
Parameters:
Name Type Description
callBack callBack A callback function to be invoked on each element. The callback is invoked with tho arguments:
  • node {CV.Node}, specifies the node as an object of CV.Node type
  • position {number}, indicates the position within the entire chart.
thisArg any Indicates the value of this keyword during the callback. If not specified, this indicates the current exontrol.Arr object

GetAlign() → {exontrol.AlignEnum}

The GetAlign() method specifies the assistant/child-nodes' alignment relative to the node itself. If null or missing, the parent's align is considered.
Returns:
Returns the assistant/child-nodes' alignment relative to the node itself. 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

GetCaption() → {string}

The GetCaption() method returns the node's caption (ex-HTML format).
Returns:
Returns the node's exHTML caption it displays
Type
string

GetCursor() → {string}

The GetCursor() method defines the mouse cursor for the node itself.
Returns:
Returns the mouse-cursor for the node itself.
Type
string

GetCursors() → {string}

The GetCursors() method defines the mouse cursor to display when pointing over a node. This property is applied to all node's descendants.
Returns:
Returns the cursors for the node and all its 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
  • "select" (selection), indicates selected nodes
  • "drag-drop", defines the cursor while the node is being dragged using the "drag-drop" action
Type
string

GetEnabled() → {boolean}

The GetEnabled() method specifies whether the node is enabled or disabled
Returns:
Returns true if the node is enabled, or false if the node is disabled.
Type
boolean

GetExpand() → {boolean}

The GetExpand() method indicates whether the node's direct-descendants are expanded or collapsed.
Returns:
Returns true if the node's direct-descendants are expanded.
Type
boolean

GetExpandAssistant() → {boolean}

The GetExpandAssistant() method indicates whether the node's assistant direct-descendants are expanded or collapsed.
Returns:
Returns true if the node's assistant direct-descendants are expanded.
Type
boolean

GetExpandChild() → {boolean}

The GetExpandChild() method indicates whether the node's child direct-descendants are expanded or collapsed.
Returns:
Returns true if the node's child direct-descendants are expanded.
Type
boolean

GetExpandGroup() → {boolean}

The GetExpandGroup() method indicates whether the node's group direct-descendants are expanded or collapsed.
Returns:
Returns true if the node's group direct-descendants are expanded.
Type
boolean

GetExpandType(nNodeType) → {boolean}

The GetExpandType() method indicates whether the node's direct-descendants are expanded or collapsed (by type).
Parameters:
Name Type Description
nNodeType CV.NodeTypeEnum Specifies 0 (no node is expanded/collapsed), null/missing/undefined (indicates all direct-descendants are expanded/collapsed), or a combination of one or more valuef of CV.NodeTypeEnum type that determines the type of descendant-nodes to expand/collapse
Returns:
Returns true if the node's direct-descendants are expanded.
Type
boolean

GetFlow() → {CV.Layout.FlowEnum}

The GetFlow() method specifies the flow and arrangement the node and its descendants nodes apply. If missing or null, the flow and arrangement of the node is inherited by its parent.
Returns:
Returns the node's flow/arrangement as a CV.Layout.FlowEnum type (string)
Type
CV.Layout.FlowEnum

GetFormatText() → {exontrol.DrawTextFormatEnum}

The GetFormatText() method specifies the format to display the node's caption.
Returns:
Returns a value of exontrol.DrawTextFormatEnum type, that defines the format to display 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

GetImage() → {string}

The GetImage() method returns the node's image.
Returns:
Returns the name of the image the current node displays.
Type
string

GetImageAlign() → {number}

The GetImageAlign() method specifies the alignment of the node's image.
Returns:
Returns the alignment of the node's image as one 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

GetImageSize() → {any}

The GetImageSize() method defines the size of the node's image.
Returns:
Returns the size, range of limits the node's image is displayed as explained:
  • {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.
Type
any

GetKey() → {string}

The GetKey() method returns the node's key.
Returns:
Returns the node's exHTML key it displays
Type
string
The GetLink() method gets the attributes of the link between a node and its descendant nodes.
Returns:
Returns the attributes of the link between a node and its descendant nodes.
Type
DisplayLinkType

GetLinka() → {DisplayLinkType}

The GetLinka() method gets the attributes of the linka between a node and its assistant-nodes.
Returns:
Returns the attributes of the link between a node and its assistant-nodes.
Type
DisplayLinkType

GetLinkg() → {DisplayLinkType}

The GetLinkg() method gets the attributes of the linkg between a node and its group-nodes.
Returns:
Returns the attributes of the link between a node and its group-nodes.
Type
DisplayLinkType

GetMargins() → {object}

The GetMargins() method indicates the horizontal/vertical/indent distance between nodes. If null or missing, the parent's margins are considered.
Returns:
Returns an object of {x,y,indent,border} type that specifies the horizontal and vertical distance between nodes.
Type
object

GetNodes() → {string}

The GetNodes() method returns the string-representation of the current node, and all its descendant-nodes.
Returns:
Returns the string representation of the current node, and all its descendant-nodes. The format of the nodes'string representation is (everything between () refers to children, and everything between [] refers to flags):
"Root(item1[flag=value]...[flag=value](sub-item1[flag=value]...[flag=value],...,sub-itemn[flag=value]...[flag=value]),...,itemn[flag=value]...[flag=value](sub-item1[flag=value]...[flag=value],...,sub-itemn[flag=value]...[flag=value]))"
The string representation supports the following flags:
  • [a], indicates a node of assistant-type
  • [g], indicates a node of group-type
  • [vert], [horz], [tree] or [htree], defines the node's flow and arrangement as vertical, horizontal, tree or horizontal tree
  • [c], indicates that the child of the node are collapsed
  • [ca], indicates that the child of assistant-type are collapsed
  • [cg], indicates that the child of group-type are collapsed
  • [dis], specifies that the node is disabled
  • [unsel], specifies that the user can't select the node
  • [id={value}], specifies the node's key/identifier. The {value} specifies the key of the node [id=home]
  • [img={value}], indicates the image of the node. The {value} indicates the name of an exontrol.HP, such as [img=logo]. The image can be added using the exontrol.HTMLPicture.Add() method
  • [shape={value}], specifies the node's appearance. The {value} indicates the name of the shape to be applied on the node itself [shape=nodeBlue]
  • [cursor={value}], indicates the mouse cursor for the node itself. The {value} indicates the mouse cursor to show once the cursor hovers the node itself [cursor=pointer]
Type
string

GetOptions() → {CV.NodeOptions}

The GetOptions() method returns the node's caption, image, ... all information the current node displays.
Returns:
Returns an object of CV.NodeOptions type
Type
CV.NodeOptions

GetPad() → {number|Array.<number>|string}

The GetPad() method specifies the space between node's content and its borders.
Returns:
Returns a value that could 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

GetParent() → {CV.Node}

The GetParent() method gets the node's parent.
Returns:
Returns the node's parent as an object of CV.Node type
Type
CV.Node

GetPosition() → {number}

The GetPosition() method gets the node's position.
Returns:
Returns the node's position (0-based)
Type
number

GetSelectable() → {boolean}

The GetSelectable() method indicates whether the user can select the node
Since:
  • 1.7
Returns:
Returns true if the node is selectable, or false if the node is not selectable
Type
boolean

GetShape() → {any}

The GetShape() method defines the shape for the node itself.
Returns:
Returns the shape for the node itself.
Type
any

GetShapes() → {string}

The GetShapes() method defines the shapes for the node including its descendants.
Returns:
Returns the shapes for the node and all 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

GetShow() → {CV.NodeTypeEnum}

The GetShow() method specifies the type(s) of direct descendant-nodes the current node shows. For instance, you can hide the node's assistant-nodes if excludes the CV.NodeTypeEnum.exNodeAssistant flag
Returns:
Returns null (no effect), one or a combination of more flags of CV.NodeTypeEnum type that defines the type of direct descendant-nodes the node displays. The CV.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
CV.NodeTypeEnum

GetShowExpandGlyphs() → {CV.NodeTypeEnum}

The GetShowExpandGlyphs() method specifies whether the node's expand/collapse glyphs is shown for different type of nodes.
Returns:
Returns null (the control's showExpandGlyphs option is considered instead), one or a combination of more flags of CV.NodeTypeEnum type that determines the type of nodes for who the expand/collapse glyphs are visible. The CV.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
CV.NodeTypeEnum

GetSingleExpandGlyphs() → {boolean}

The GetSingleExpandGlyphs() method specifies whether the node displays a single or multiple expand/collapse glyphs.
Returns:
Returns true if the node displays a single expand/collapse glyphs.
Type
boolean

GetSize() → {any}

The GetSize() method specifies the size, range of limits the node's caption is displayed.
Returns:
Returns the size, range of limits the node's caption is displayed as explained:
  • {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)
Type
any

GetVisible() → {boolean}

The GetVisible() method returns whether the current node is visible or hidden
Returns:
Returns true if the node is visible, or false if the node is not visible
Type
boolean

Item(key) → {null|CV.Node}

The Item() method searches for a node giving its key or caption
Parameters:
Name Type Description
key any The key parameter can be any of the following:
  • key {object}, Indicates an object of CV.Node that specifies the node itself
  • key {string}, Specifies the node's key of caption
Returns:
Returns null or an object of CV.Node type with specified key / caption that descends from the current node.
Type
null | CV.Node

Remove()

The Remove() method removes the node (including all its descendants)

SetAlign(value)

The SetAlign() method changes the assistant/child-nodes' alignment relative to the node itself.
Parameters:
Name Type Description
value exontrol.AlignEnum Specifies the assistant/child-nodes' alignment relative to the node itself. If null or 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

SetCaption(value) → {object}

The SetCaption() method assigns a new ex-HTML caption to the current node
Parameters:
Name Type Description
value string Specifies a new ex-HTML caption to be assigned to the node
Returns:
Returns the node itself.
Type
object

SetCursor(value)

The SetCursor() method changes the mouse cursor for the node itself.
Parameters:
Name Type Description
value any A string expression that defines the mouse cursor for the node itself.

SetCursors(value)

The SetCursors() method defines the cursors for the node and its descendants.
Parameters:
Name Type Description
value string A string expression that defines the cursors each part of the control can display. 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
  • "select" (selection), indicates selected nodes
  • "drag-drop", defines the cursor while the node is being dragged using the "drag-drop" action

SetEnabled(value)

The SetEnabled() method enables or disables the node
Parameters:
Name Type Description
value boolean Indicates a boolean expression that specifies whether the current node is enabled or disabled

SetExpand(value)

The SetExpand() method expands or collapses the node's direct-descendants.
Parameters:
Name Type Description
value boolean Specifies whether the node's direct-descendants are expanded or collapsed

SetExpandAssistant(value)

The SetExpandAssistant() method expands or collapses the node's assistant direct-descendants.
Parameters:
Name Type Description
value boolean Specifies whether the node's assistant direct-descendants are expanded or collapsed

SetExpandChild(value)

The SetExpandChild() method expands or collapses the node's child direct-descendants.
Parameters:
Name Type Description
value boolean Specifies whether the node's child direct-descendants are expanded or collapsed

SetExpandGroup(value)

The SetExpandGroup() method expands or collapses the node's group direct-descendants.
Parameters:
Name Type Description
value boolean Specifies whether the node's group direct-descendants are expanded or collapsed

SetExpandType(nNodeType, value)

The SetExpandType() method expands or collapses the node's direct-descendants (by type).
Parameters:
Name Type Description
nNodeType CV.NodeTypeEnum Specifies 0 (no node is expanded/collapsed), null/missing/undefined (indicates all direct-descendants are expanded/collapsed), or a combination of one or more valuef of CV.NodeTypeEnum type that determines the type of descendant-nodes to expand/collapse
value boolean Specifies whether the node's direct-descendants are expanded or collapsed

SetFlow(value)

The SetFlow() method changes the flow and arrangement the node and its descendants nodes apply. If missing or null, the flow and arrangement of the node is inherited by its parent.
Parameters:
Name Type Description
value CV.Layout.FlowEnum Specifies the node's flow/arrangement as a CV.Layout.FlowEnum type (string). It can be null/empty/undefined which indicates that the parent's flow / arrangement is considered.

SetFormatText(value)

The SetFormatText() method changes the format to display the node's caption.
Parameters:
Name Type Description
value exontrol.DrawTextFormatEnum Specifies a value of exontrol.DrawTextFormatEnum value 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.

SetImage(value)

The SetImage() method changes the node's image. The image can be added using the exontrol.HTMLPicture.Add() method
Parameters:
Name Type Description
value string Indicates the name of the image the node displays.

SetImageAlign(value)

The SetImageAlign() method changes the alignment of the node's image.
Parameters:
Name Type Description
value number Defines the format to show the node's caption. 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

SetImageSize(value)

The SetImageSize() method changes the size of the node's image.
Parameters:
Name Type Description
value any Indicates the size of the node's image as explained:
  • {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.

SetKey(value)

The SetKey() method assigns a new key to the current node
Parameters:
Name Type Description
value string Specifies a new key to be assigned to the node
The SetLink() method changes the attributes of the link between a node and its descendant nodes.
Parameters:
Name Type Description
value DisplayLinkType Specifies the attributes of the link between a node and its descendant nodes.

SetLinka(value)

The SetLinka() method changes the attributes of the linka between a node and its assistant-nodes.
Parameters:
Name Type Description
value DisplayLinkType Specifies the attributes of the link between a node and its assistant-nodes.

SetLinkg(value)

The SetLinkg() method changes the attributes of the linkg between a node and its group-nodes.
Parameters:
Name Type Description
value DisplayLinkType Specifies the attributes of the link between a node and its group-nodes.

SetMargins(value)

The SetMargins() method changes the horizontal and/or vertical and/or indent distance between nodes.
Parameters:
Name Type Description
value object Specifies an object of {x,y,indent,border} type that specifies the horizontal and vertical distance between nodes. If null or missing, the parent's margins are considered.

SetNodes(value) → {CV.Node}

The SetNodes() method assigns nodes from a string-representation, to the current node.
Parameters:
Name Type Description
value string Specifies the nodes to assign to the current node. The format of the nodes'string representation is (everything between () refers to children, and everything between [] refers to flags):
"Root(item1[flag=value]...[flag=value](sub-item1[flag=value]...[flag=value],...,sub-itemn[flag=value]...[flag=value]),...,itemn[flag=value]...[flag=value](sub-item1[flag=value]...[flag=value],...,sub-itemn[flag=value]...[flag=value]))"
The string representation supports the following flags:
  • [a], indicates a node of assistant-type
  • [g], indicates a node of group-type
  • [vert], [horz], [tree] or [htree], defines the node's flow and arrangement as vertical, horizontal, tree or horizontal tree
  • [c], indicates that the child of the node are collapsed
  • [ca], indicates that the child of assistant-type are collapsed
  • [cg], indicates that the child of group-type are collapsed
  • [dis], specifies that the node is disabled
  • [unsel], specifies that the user can't select the node
  • [id={value}], specifies the node's key/identifier. The {value} specifies the key of the node [id=home]
  • [img={value}], indicates the image of the node. The {value} indicates the name of an exontrol.HP, such as [img=logo]. The image can be added using the exontrol.HTMLPicture.Add() method
  • [shape={value}], specifies the node's appearance. The {value} indicates the name of the shape to be applied on the node itself [shape=nodeBlue]
  • [cursor={value}], indicates the mouse cursor for the node itself. The {value} indicates the mouse cursor to show once the cursor hovers the node itself [cursor=pointer]
Returns:
Returns the node itself.
Type
CV.Node
Example
Root.SetNodes("Root(1,2,3[g])"), adds two child-nodes 1, 2 and 3 as a group-node of the root.

SetOptions(oOpts)

The SetOptions() method assigns a caption, image, ... to the current node.
Parameters:
Name Type Description
oOpts CV.NodeOptions Specifies an object of CV.NodeOptions type that holds information about the node, such as caption, image and so on. If the oOpts parameter is not-of object type it indicates the node's caption instead

SetPad(value)

The SetPad() method changes the node's padding or the space between node's content and its borders.
Parameters:
Name Type Description
value number | Array.<number> | string Specifies a value that could 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

SetParent(value) → {boolean}

The SetParent() method sets the node's parent
Parameters:
Name Type Description
value string | CV.Node The value parameter can be any of the following:
  • value {CV.Node}, Indicates an object of CV.Node that specifies the node itself
  • value {string}, Specifies the node's key or caption
Returns:
Returns true, if the node's parent has been changed
Type
boolean

SetPosition(value) → {boolean}

The SetPosition() method sets the node's position
Parameters:
Name Type Description
value number Indicates the node's new position (0-based)
Returns:
Returns true, if the node's position has been changed
Type
boolean

SetSelectable(value)

The SetSelectable() method makes the node selectable or not selectable
Parameters:
Name Type Description
value boolean Indicates a boolean expression that specifies whether the node is selectable or not selectable
Since:
  • 1.7
Example
false {boolean}, the user can't select the node
 true {boolean}, the user can select the node

SetShape(value)

The SetShape() method changes the shape for the node itself.
Parameters:
Name Type Description
value any The value could be any of the following:
  • {null}, no custom-shape is applied
  • {string}, defines a CSS color to fill the object with (applied only for known colors), else it indicates the name of the custom-shape to apply on the object
  • {exontrol.Def.Shape}, indicates a reference to a shape of exontrol.Def.Shape type
  • {object}, holds a reference to an object of {normal, hover, click, disabled} type, where normal, hover, click and disabled are objects of exontrol.Def.Shape type.

SetShapes(value)

The SetShapes() method defines the shapes for the node and its descendants.
Parameters:
Name Type Description
value string A string expression that defines the shapes each part of the control can display. 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

SetShow(value)

The SetShow() method shows or hides the descendant-nodes the current node, like assistant, child or group-nodes.
Parameters:
Name Type Description
value CV.NodeTypeEnum Indicates null (no effect), one or a combination of more flags of CV.NodeTypeEnum type that defines the type of direct descendant-nodes the node displays. The CV.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

SetShowExpandGlyphs(value)

The SetShowExpandGlyphs() method shows or hides the node's expand/collapse glyphs is shown for different type of nodes.
Parameters:
Name Type Description
value CV.NodeTypeEnum Specifies null (the control's showExpandGlyphs option is considered instead), one or a combination of more flags of CV.NodeTypeEnum type that determines the type of nodes for who the expand/collapse glyphs are visible. The CV.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

SetSingleExpandGlyphs(value)

The SetSingleExpandGlyphs() method shows one or more expand/collapse glyphs for the nodes.
Parameters:
Name Type Description
value boolean A boolean expression that specifies whether the node shows one or multiple expand/collapse glyphs

SetSize(value)

The SetSize() method changes the size, range of limits the node's caption is displayed.
Parameters:
Name Type Description
value any Defines the size, range of limits the node's caption is displayed as explained:
  • {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)

SetVisible(value)

The SetVisible() method shows or hides the current node
Parameters:
Name Type Description
value boolean Indicates a boolean expression that specifies whether the current node is visible or hidden

ToggleExpand(nNodeType) → {boolean}

The ToggleExpand() method toggles the node's expand state for specified type of nodes.
Parameters:
Name Type Description
nNodeType CV.NodeTypeEnum Specifies 0 (no effect), null/missing/undefined (indicates all node's descendants), or a combination of one or more valuef of CV.NodeTypeEnum type that determines the type of descendant-nodes
Returns:
Returs true, if the node has been expanded.
Type
boolean