Jx.TreeFolder

Extends: Jx.TreeItem

A Jx.TreeFolder is an item in a tree that can contain other items.  It is expandable and collapsible.

Example

Extends

Jx.TreeItem

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Jx.TreeFolderExtends: Jx.TreeItem
Properties
subDomObj{HTMLElement} an HTML container for the things inside the folder
nodes{Array} an array of references to the javascript objects that are children of this folder
Options
openis the folder open? 
Constructor
Jx.TreeFolderCreate a new instance of Jx.TreeFolder
Functions
finalizeClean up a TreeFolder.
finalizeFolderInternal method to clean up folder-related stuff.
cloneCreate a clone of the TreeFolder
isLastNodeIndicates if a node is the last thing in the folder.
updateUpdate the CSS of the TreeFolder’s DOM element in case it has changed position.
appendappend a node at the end of the sub-tree
insertinsert a node after refNode.
removeremove the specified node from the tree
replaceReplace a node with another node
clickedhandle the user clicking on this folder by expanding or collapsing it.
expandExpands the folder
collapseCollapses the folder
findChildGet a reference to a child node by recursively searching the tree

Properties

subDomObj

{HTMLElement} an HTML container for the things inside the folder

nodes

{Array} an array of references to the javascript objects that are children of this folder

Options

open

is the folder open?  false by default.

Constructor

Jx.TreeFolder

Create a new instance of Jx.TreeFolder

Parameters

optionsJx.TreeFolder.Options and Jx.TreeItem.Options

Functions

finalize

finalize: function()

Clean up a TreeFolder.

finalizeFolder

finalizeFolder: function()

Internal method to clean up folder-related stuff.

clone

clone : function()

Create a clone of the TreeFolder

Returns

{Jx.TreeFolder} a copy of the TreeFolder

isLastNode

isLastNode : function(node)

Indicates if a node is the last thing in the folder.

Parameters

node{Jx.TreeItem} the node to check

Returns

{Boolean}

update

update : function(shouldDescend)

Update the CSS of the TreeFolder’s DOM element in case it has changed position.

Parameters

shouldDescend{Boolean} propagate changes to child nodes?

append

append : function(node)

append a node at the end of the sub-tree

Parameters

node{Object} the node to append.

insert

insert : function(node,
refNode)

insert a node after refNode.  If refNode is null, insert at beginning

Parameters

node{Object} the node to insert
refNode{Object} the node to insert before

remove

remove : function(node)

remove the specified node from the tree

Parameters

node{Object} the node to remove

replace

replace: function(newNode,
refNode)

Replace a node with another node

Parameters

newNode{Object} the node to put into the tree
refNode{Object} the node to replace

Returns

{Boolean} true if the replacement was successful.

clicked

clicked : function(e)

handle the user clicking on this folder by expanding or collapsing it.

Parameters

e{Event} the event object

expand

expand : function()

Expands the folder

collapse

collapse : function()

Collapses the folder

findChild

findChild : function(path)

Get a reference to a child node by recursively searching the tree

Parameters

path{Array} an array of labels of nodes to search for

Returns

{Object} the node or null if the path was not found

Extends: Object
finalize: function()
Clean up a TreeFolder.
finalizeFolder: function()
Internal method to clean up folder-related stuff.
clone : function()
Create a clone of the TreeFolder
isLastNode : function(node)
Indicates if a node is the last thing in the folder.
update : function(shouldDescend)
Update the CSS of the TreeFolder’s DOM element in case it has changed position.
append : function(node)
append a node at the end of the sub-tree
insert : function(node,
refNode)
insert a node after refNode.
remove : function(node)
remove the specified node from the tree
replace: function(newNode,
refNode)
Replace a node with another node
clicked : function(e)
handle the user clicking on this folder by expanding or collapsing it.
expand : function()
Expands the folder
collapse : function()
Collapses the folder
findChild : function(path)
Get a reference to a child node by recursively searching the tree
Create a new instance of Jx.TreeFolder