Class SweetDevRia.TreeNode
Defined in: TreeNode.js.
Constructor Attributes | Constructor Name and Description |
---|---|
SweetDevRia.TreeNode(id, label, parentNode, nodeType, position, tooltip)
This is the TreeNode component class
The constructor is in charge of adding the node to its parent
|
Field Attributes | Field Name and Description |
---|---|
<static> |
SweetDevRia.TreeNode.DIV_SUFFIXE
Constants for DOM node generation
|
Method Attributes | Method Name and Description |
---|---|
addChild(child, position)
Adds a child to this node, at the specified position.
|
|
This method is called after checking this node
To be overridden !!
|
|
This method is called after collapsing this node
To be overridden !!
|
|
This method is called after expanding this node
To be overridden !!
|
|
afterSelect(notify)
This method is called after selecting this node
|
|
This method is called after unchecking this node
To be overridden !!
|
|
This method is called after unselecting this node
To be overridden !!
|
|
Alternates color of the nodes placed after the current node
|
|
This method is called before checking this node
To be overridden !!
|
|
This method is called before collapsing this node
To be overridden !!
|
|
This method is called before expanding this node
To be overridden !!
|
|
beforeSelect(notify)
This method is called before selecting this node
To be overridden !!
|
|
This method is called before unchecking this node
To be overridden !!
|
|
This method is called before unselecting this node
To be overridden !!
|
|
check(verifiyParent, sendEvent)
Perform a check on this node.
|
|
collapse()
Collapse this node.
|
|
drawChildren(initDD)
Render the children of this node in HTML.
|
|
expand()
Expand this node.
|
|
Expand this node and all its children.
|
|
getChild(nodeId)
Returns the searched Node or null if not found
|
|
Returns the children of this node, an empty Array if this node has no child, or null if for a leaf or if the nodes are not loaded.
|
|
<private> |
Render the children of this node, returning the DOM string
|
getId()
Returns the id of this node.
|
|
<private> |
Returns the identation array as it must be displayed to render a hierarchy.Stops before the icon render
|
Return the index of this node in its parent, or null if this node has no parent
|
|
Return the generic information map sent by the server for this node, or null if none have been defined
|
|
getLabel()
Returns the label of this node.
|
|
<private> |
Return the last indentation className, used of the DOM render
|
Return the next node in the tree view.
|
|
Return the node type of the node
|
|
Return the previous node in the tree view.
|
|
Returns true if this node has, or may have some children (loaded or not)
|
|
hasChildStateChecked(state)
Return true if one of this node child has this checked state
|
|
Redefine this method to bind an action on this node icon
|
|
<private> |
initDD(recursiv)
Initialize the Drag and Drop for this node
|
<private> |
initTree(tree)
Initiate the tree object pointer for this node
|
Return true if this node can be checked, according to its node type value
|
|
Return the state check of this node.
|
|
Return true if the node is the last child of its parent
|
|
Return true if the node is the last one of the tree view (the bottom one)
|
|
isLeaf()
Return the leaf state of the node, according to its node type
|
|
isParent(node)
Return true if this node is a parent of the one given in parameter.
|
|
Redefine this method to bind an action on this node label
|
|
modifyNode(label, nodeType)
Modify the label and transmit this modification to the server
|
|
refresh(reload)
Refreshes the content of the node and its children by redrawing the content of its container
|
|
<private> |
refreshIndentationImages(recursiv)
Refresh the indentation images (vertical line or blank image).
|
<private> |
Refresh the last indentation images (+/-) of this node.
|
<private> |
render()
Render the node, and its children
|
<private> |
renderContent(drawChildren)
Render the content of the node (excluding the container), and its children
|
select(notify)
Perform a selection on this node.
|
|
sendCheckUncheckNode(checked, propagateToChilds)
|
|
setLabel(label)
Set a label on this node
|
|
setNodeType(nodeType)
Set a node type for this node.
|
|
Swap the check state of this node
|
|
Swap the visibility state of this node.
|
|
toRender()
Tell if the node should be rendered
|
|
uncheck(uncheckChildren, sendEvent)
Perform an uncheck on this node.
|
|
unselect()
Perform an unselection on this node.
|
|
<private> |
Update the render of the icon of this node according to its loading state
|
Class Detail
SweetDevRia.TreeNode(id, label, parentNode, nodeType, position, tooltip)
This is the TreeNode component class
The constructor is in charge of adding the node to its parent
- Parameters:
- {String} id
- Id of this tree node
- {String} label
- Label of this node
- {TreeNode} parentNode
- The parent node of this node, or null if root
- {NodeType} nodeType
- The node type of this node.
- {int} position
- The position of this node in its parent.
- tooltip
Field Detail
<static>
SweetDevRia.TreeNode.DIV_SUFFIXE
Constants for DOM node generation
Method Detail
addChild(child, position)
Adds a child to this node, at the specified position.
Does nothing if the node type is set as a leaf
- Parameters:
- {TreeNode} child
- the child to add
- {int} position
- the position to add
afterCheck()
This method is called after checking this node
To be overridden !!
afterCollapse()
This method is called after collapsing this node
To be overridden !!
afterExpand()
This method is called after expanding this node
To be overridden !!
afterSelect(notify)
This method is called after selecting this node
- Parameters:
- {boolean} notify
- true if the notification of the server must be performed, false otherwise (restoration action). To be overridden !!
afterUncheck()
This method is called after unchecking this node
To be overridden !!
afterUnselect()
This method is called after unselecting this node
To be overridden !!
alternateNodeStyle()
Alternates color of the nodes placed after the current node
{boolean}
beforeCheck()
This method is called before checking this node
To be overridden !!
- Returns:
- True if this method can be called, else false.
{boolean}
beforeCollapse()
This method is called before collapsing this node
To be overridden !!
- Returns:
- True if this method can be called, else false.
{boolean}
beforeExpand()
This method is called before expanding this node
To be overridden !!
- Returns:
- True if this method can be called, else false.
{boolean}
beforeSelect(notify)
This method is called before selecting this node
To be overridden !!
- Parameters:
- {boolean} notify
- true if the notification of the server must be performed, false otherwise (restoration action).
- Returns:
- True if this method can be called, else false.
{boolean}
beforeUncheck()
This method is called before unchecking this node
To be overridden !!
- Returns:
- True if this method can be called, else false.
{boolean}
beforeUnselect()
This method is called before unselecting this node
To be overridden !!
- Returns:
- True if this method can be called, else false.
check(verifiyParent, sendEvent)
Perform a check on this node. Check all this node's children
- Parameters:
- {boolean} verifiyParent
- A boolean indicating if the parent must be verified for a check on this node check. Avoid circles.
- {boolean} sendEvent
- (true by default) A boolean indicating an event must be sent to server to update model. Avoid circles.
collapse()
Collapse this node. Does nothing on leaf or if the node is already collapsed.
drawChildren(initDD)
Render the children of this node in HTML. Do not re-render this current node.
- Parameters:
- {boolean} initDD
- a boolean indicating if the Drag and Drop must be initialized or not
expand()
Expand this node. Does nothing on leaf or if the node is already open.
Process an Ajax request to the server if this node is not loaded yet.
expandAll()
Expand this node and all its children. Does nothing on leaf or if the node has no children loaded.
{TreeNode}
getChild(nodeId)
Returns the searched Node or null if not found
- Parameters:
- nodeId
- Returns:
- the searched Node or null if not found
{String}
getChildren()
Returns the children of this node, an empty Array if this node has no child, or null if for a leaf or if the nodes are not loaded.
- Returns:
- the children of this node.
<private>
{String}
getChildrenRender()
Render the children of this node, returning the DOM string
- Returns:
- the DOM string corresponding to this node's children content
{String}
getId()
Returns the id of this node.
- Returns:
- the if of this node.
<private>
{Array}
getIndentationArray()
Returns the identation array as it must be displayed to render a hierarchy.Stops before the icon render
- Returns:
- the identation array as it must be displayed to render a hierarchy
getIndexChild()
Return the index of this node in its parent, or null if this node has no parent
- Returns:
- the index of this node in its parent
{Map}
getInformation()
Return the generic information map sent by the server for this node, or null if none have been defined
- Returns:
- the generic information map sent by the server for this node
{String}
getLabel()
Returns the label of this node.
- Returns:
- the label of this node.
<private>
{String}
getLastIndentationClass()
Return the last indentation className, used of the DOM render
- Returns:
- the last indentation className, used of the DOM render
getNextNode()
Return the next node in the tree view. This method goes cross nodes and across levels.
Used mostly for the navigation
- Returns:
- the next node in the tree view.
{NodeType}
getNodeType()
Return the node type of the node
- Returns:
- the node type of the node
getPreviousNode()
Return the previous node in the tree view. This method goes cross nodes and across levels.
Used mostly for the navigation
- Returns:
- the previous node in the tree view.
{boolean}
hasChildren()
Returns true if this node has, or may have some children (loaded or not)
- Returns:
- true if this node has or may have children
{boolean}
hasChildStateChecked(state)
Return true if one of this node child has this checked state
- Parameters:
- {boolean} state
- the check state to look for
- Returns:
- true if one of this node child has this checked state, false otherwise
iconAction()
Redefine this method to bind an action on this node icon
<private>
initDD(recursiv)
Initialize the Drag and Drop for this node
- Parameters:
- {boolean} recursiv
- a boolean indicating if the Drag and Drop should be propagated to the children
<private>
initTree(tree)
Initiate the tree object pointer for this node
- Parameters:
- {Tree} tree
- the tree to initiate
{boolean}
isCheckable()
Return true if this node can be checked, according to its node type value
- Returns:
- true if this node can be checked, according to its node type value, false otherwise
{boolean}
isChecked()
Return the state check of this node.
- Returns:
- true if the node is checked, false otherwise
isLastChild()
Return true if the node is the last child of its parent
- Returns:
- Return true if the node is the last child of its parent
{boolean}
isLastTreeNode()
Return true if the node is the last one of the tree view (the bottom one)
- Returns:
- true if the node is the last one of the tree view (the bottom one)
{boolean}
isLeaf()
Return the leaf state of the node, according to its node type
- Returns:
- the leaf state of the node
{boolean}
isParent(node)
Return true if this node is a parent of the one given in parameter. Recursiv function.
- Parameters:
- {TreeNode} node
- the node tested as a child of this one
- Returns:
- true if this node is a parent of the one given in parameter
labelAction()
Redefine this method to bind an action on this node label
modifyNode(label, nodeType)
Modify the label and transmit this modification to the server
- Parameters:
- {String} label
- The new label of the node
- {String} nodeType
- The id of the new type of node
refresh(reload)
Refreshes the content of the node and its children by redrawing the content of its container
- Parameters:
- {boolean} reload
- If true, all children are clear and so reload from server.
<private>
refreshIndentationImages(recursiv)
Refresh the indentation images (vertical line or blank image). Recursiv function.
- Parameters:
- recursiv
<private>
refreshLastIndentationClass()
Refresh the last indentation images (+/-) of this node.
<private>
{String}
render()
Render the node, and its children
- Returns:
- the DOM string corresponding to this node
<private>
{String}
renderContent(drawChildren)
Render the content of the node (excluding the container), and its children
- Parameters:
- drawChildren
- Returns:
- the DOM string corresponding to this node's content
select(notify)
Perform a selection on this node. If a node was previously selected, it turns to unselected.
- Parameters:
- {boolean} notify
- true if the notification of the server must be performed, false otherwise (restoration action).
sendCheckUncheckNode(checked, propagateToChilds)
- Parameters:
- checked
- propagateToChilds
setLabel(label)
Set a label on this node
- Parameters:
- label
setNodeType(nodeType)
Set a node type for this node.
Every modification will be performed by this function, regarding the incompatibilities on the previous and the new node types.
This means removing the children if the leaf state goes to false...
- Parameters:
- nodeType
swapCheck()
Swap the check state of this node
swapCollapse()
Swap the visibility state of this node.
{boolean}
toRender()
Tell if the node should be rendered
- Returns:
- true if the node has to be render (for the treegrid)
uncheck(uncheckChildren, sendEvent)
Perform an uncheck on this node.
- Parameters:
- {boolean} uncheckChildren
- A boolean indicating if the children must be unchecked to.
- {boolean} sendEvent
- (true by default) A boolean indicating an event must be sent to server to update model. Avoid circles.
unselect()
Perform an unselection on this node.
<private>
updateIconRender()
Update the render of the icon of this node according to its loading state