Zapatec Utils

Class Zapatec.BasicTree

Object
   |
   +--Zapatec.BasicTree

class Zapatec.BasicTree

Defined in tree.js


Field Summary
<static>  Object all
          This global variable keeps a "hash table" (that is, a plain JavaScript object) mapping ID-s to references to Zapatec.BasicTree objects.
 
Constructor Summary
Zapatec.BasicTree(el, config)
            The Zapatec.BasicTree object constructor.
 
Method Summary
 Object _getTree(tree_id, dont_call)
           \internal This function is used when "dynamic initialization" is on.
 void appendChild(parent, newChild, atStart)
           Append a child to the start or end of the given parent.
 void collapseAll()
           Call this function to collapse all items in the tree.
 Object createItem(li, parent, next_li, level, atStart)
           \internal This function walks through a LI element and creates the HTML elements associated with that tree item.
 Object createTree(list, parent, level)
           \internal Function that creates a (sub)tree.
 void destroy()
           Destroys the tree.
 void expandAll()
           Call this function to expand all items in the tree.
 Object getParent(id, mode)
           Call to get the parent to append, insert or remove a child either at start or end position or in between two nodes of the (sub-)tree.
 void init(el, config)
          
 void insertBefore(newChild, refChild)
           A new child can be inserted between two nodes/children or before one node /children at the same tree level.
 void item_addDefaultIcon(item, className)
           \internal This function adds a TD element having a certain class attribute which helps having a tree containing icons without defining IMG tags for each item.
 void item_addIcon(item, img)
           \internal This function does different things, depending on whether the \b img parameter is passed or not.
 void itemClicked(item_id)
           This function gets called from a global event handler when some item was clicked.
 Object makeNode(html, type)
           Call this function to create a html element with the optional element type specified.
 void onItemSelect()
           Third party code can override this member in order to add an event handler that gets called each time a tree item is selected.
 void removeChild(oldChild)
           An old child node in the tree can be removed at any level.
 void sync(item_id)
           Call this function to synchronize the tree to a given item.
 void toggleAll()
           Call this function to toggle all items in the tree.
 Object toggleItem(item_id, state)
           This function toggles an item if the \b state parameter is not specified.
<static> void onItemToggle()
           \internal This is a global event handler that gets called when a tree item is clicked.

Field Detail

all

<static> Object all