Objects Properties
LiknoTreeElement()
You do not need to construct a LiknoTreeElement object directly in code. Instead, once you have a LiknoTreeRoot object, you use the addLeafWithParams and insertLeafWithParamsAfter functions to create and add nodes to your tree.
Properties
All properties can be set/get using the appropriate function, e.g. you can set the isSelectable property of the LiknoTreeElement using the setIsSelectable() function and you can get the current value of this property for a leaf using the getIsSelectable() function.
Although Javascript is not a strongly typed language, a generic property type is indicated under every property name.
If the property type is an array, a number in brackets next to it will indicate the required number of elements in the array (e.g. array(3) means that the property is required to be an array of exactly 3 elements). An ellipsis ("...") means that the array can have a variable number of elements.
classnames
array(3)
This is an array of 3 strings specifying the suffix of the CSS class name used for the normal, mouseover and selected state of this node.
Example: |
LiknoTrees[0].addClass("default", "font-family:Tahoma; font-size:11px; color:#FFFFFF; background-color:; text-decoration:none; font-weight:normal; padding-left:4px; padding-right:4px;");
LiknoTrees[0].addClass("mouseover", "font-family:Tahoma; font-size:11px; font-weight: normal; text-decoration:underline; color:#d9f6ab; padding-left:4px; padding-right:4px;");
LiknoTrees[0].addClass("selected", "font-family:Tahoma; font-size:11px; font-weight: bold; color:#b1efff; background-color:; padding-left:4px; padding-right:4px;");
var leaf = LiknoTrees[0].findLeafByText("examples", false, false, true);
leaf.setClassnames("default", "mouseover", "selected"); |
content string
Textual or HTML content of the node. This is what is displayed next to the icon of the node. Although you can use the setContent function to change the content property for an item at runtime, most of the time you will set the content of a node using the addLeafWithParams function.
In the tree below, the content of the "Fruit" node is simply "Fruit" while the content of the "Tomatoes" node is "Tomatoes <img src='images/tomatoes.gif' style='border:0; vertical-align:top;'>"

data string An array of optional user-defined values which can be associated with this node. Each node can hold an arbitrary number of values in this array, and these values can be set/retrieved and used for sorting the nodes of the tree. For example, you could have a tree showing Wall Street market stock names, and have their associated values stored internally in the tree using this property.
depth number
Indicates the depth of this node, starting from 0 for the root of the tree.
» |