mode - enabled/disabled [ can be true/false/temporary_disabled - last value mean that tree can be D-n-D can be switched to true later ]
enableDragAndDropScrolling(mode)
[Professional]
enable/disable auto scrolling while drag-and-drop
File required:dhtmlXTree.js
mode - enabled/disabled
enableHighlighting(mode)
[Professional]
enable item highlighting (item text highlited on mouseover)
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableMercyDrag(mode)
[Professional]
enable drag without removing (copy instead of move)
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableMultiLineItems(width)
[Professional]
enable multi line items
File required:dhtmlXTree.js
width - text width, if equls zero then use single lines items;
enableSmartCheckboxes(mode)
[Professional]
enable smart checkboxes ,true by default (auto checking childs and parents for 3-state checkboxes)
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableSmartXMLParsing(mode)
[Professional]
enable/disable smart XML parsing mode (usefull for big, well structured XML)
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableThreeStateCheckboxes(mode) enable three state checkboxes
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
enableTreeImages(mode) enable tree images
File required:dhtmlXTree.js
mode - 1 - on, 0 - off;
focusItem(itemId)
[Professional]
focus item in tree
File required:dhtmlXTree.js
itemId - item Id
getXMLState()
[Professional]
return current state of XML loading
File required:dhtmlXTree.js
loadXML(file,afterCall) load tree from xml file
File required:dhtmlXTree.js
file - link too XML file
afterCall - function which will be called after xml loading
loadXMLString(xmlString,afterCall) load tree from xml string
File required:dhtmlXTree.js
xmlString - XML string
afterCall - function which will be called after xml loading
setChildCalcHTML( htmlA,htmlB )
[Professional]
set child calculation prefix and postfix
File required:dhtmlXTree.js
htmlA - postfix ([ - by default)
htmlB - postfix (] - by default)
setChildCalcMode( mode )
[Professional]
set child calculation mode
File required:dhtmlXTree.js
mode - mode name as string . Possible values: child - child, no recursive; leafs - child without subchilds, no recursive; ,childrec - child, recursive; leafsrec - child without subchilds, recursive; disabled (disabled by default)
setDragBehavior(mode)
[Professional]
set Drag-And-Drop behavior (child - drop as chils, sibling - drop as sibling, complex - complex drop behaviour )
File required:dhtmlXTree.js
mode - behavior name (child,sibling,complex)
setDragHandler(func) set function called when drag-and-drop event occured
File required:dhtmlXTree.js
aFunc - event handling function
setDropHandler(func)
[Professional]
set function called after drag-and-drap event occured
File required:dhtmlXTree.js
func - event handling function
setEscapingMode(mode)
[Professional]
set escaping mode (used for escaping ID in server requests)
File required:dhtmlXTree.js
mode - escaping mode ("utf8" for UTF escaping)
setImagePath( newPath ) set path to image directory
File required:dhtmlXTree.js
newPath - path to image directory
setListDelimeter(separator) set list separator (comma by default)
File required:dhtmlXTree.js
separator - char or string using for separating items in lists
setOnCheckHandler(func) set function called before checkbox checked/unchecked
File required:dhtmlXTree.js
func - event handling function
setOnClickHandler(func) set function called when tree node selected
File required:dhtmlXTree.js
func - event handling function
setOnDblClickHandler(func) set function called when tree node double clicked
File required:dhtmlXTree.js
func - event handling function
setOnLoadingEnd(func)
[Professional]
set function called after xml loading/parsing ended
File required:dhtmlXTree.js
func - event handling function
setOnLoadingStart(func)
[Professional]
set function called before xml loading/parsing started
File required:dhtmlXTree.js
func - event handling function
setOnOpenHandler(func) set function called before tree node opened/closed
File required:dhtmlXTree.js
func - event handling function
setOnRightClickHandler(func) set function called when tree node selected
File required:dhtmlXTree.js
func - event handling function
setXMLAutoLoading(filePath) enables dynamic loading from XML
File required:dhtmlXTree.js
filePath - name of script returning XML;
sortTree(nodeId,order,all_levels)
[Professional]
reorder items in tree
File required:dhtmlXTree_sb.js
nodeId - id of top node
all_levels - sorting all levels or only current level
order - sorting order - ASC or DES
Selection control
getChildItemIdByIndex(itemId,index) retun child node id by index
File required:dhtmlXTree.js
itemId - parent node id
index - index of child node
getItemIdByIndex(itemId,index) retun node id by index
File required:dhtmlXTree.js
itemId - node id
index - index of node, 0 based
getSelectedItemId() retun selected item id
File required:dhtmlXTree.js
getSelectedItemText() retun selected node text
File required:dhtmlXTree.js
selectItem(itemId,mode) select node ( and optionaly fire onselect event)
File required:dhtmlXTree.js
itemId - node id
mode - If true, script function for selected node will be called.
setXMLAutoLoadingBehaviour(mode)
[Professional]
define which script be called on dynamic loading
File required:dhtmlXTree.js
mode - id for some_script?id=item_id ; name for some_scriptitem_id, xmlname for some_scriptitem_id.xml
Add/delete
clearCut() clear cut
File required:dhtmlXTree.js
deleteChildItems(itemId) delete all children of node
File required:dhtmlXTree.js
itemId - node id
deleteItem(itemId,selectParent) delete node
File required:dhtmlXTree.js
itemId - node id
selectParent - If true parent of deleted item get selection, else no selected items leaving in tree.
doCut() mark selected item as cutted
File required:dhtmlXTree.js
doPaste(itemId) insert previously cutted branch
File required:dhtmlXTree.js
itemId - id of new parent node
enableAutoSavingSelected(mode,cookieName)
[Professional]
enable/disable autosaving selected node in cookie
File required:dhtmlXTree_xw.js
mode - true/false
findItem(searchStr,direction,top)
[Professional]
find tree item by text, select and focus it
File required:dhtmlXTree.js
searchStr - search text
direction - 0: top -> bottom; 1: bottom -> top
top - 1: start searching from top
findItemIdByLabel(searchStr,direction,top)
[Professional]
find tree item by text
File required:dhtmlXTree.js
searchStr - search text
direction - 0: top -> bottom; 1: bottom -> top
top - 1: start searching from top
insertNewChild(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs) create new node as a child to specified with parentId
File required:dhtmlXTree.js
parentId - parent node id
itemId - new node id
itemText - new node label
itemActionHandler - function fired on node select event (optional)
image1 - image for node without childrens; (optional)
image2 - image for closed node; (optional)
image3 - image for opened node (optional)
optionStr - options string (optional)
childs - node children flag (for dynamical trees) (optional)
insertNewItem(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs) create new node as a child to specified with parentId
File required:dhtmlXTree.js
parentId - parent node id
itemId - new node id
itemText - new node text
itemActionHandler - function fired on node select event (optional)
image1 - image for node without childrens; (optional)
image2 - image for closed node; (optional)
image3 - image for opened node (optional)
optionStr - options string (optional)
childs - node childs flag (for dynamical trees) (optional)
insertNewNext(itemId,newItemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs) create new node next to specified
File required:dhtmlXTree.js
itemId - node id
newItemId - new node id
itemText - new node text
itemActionHandler - function fired on node select event (optional)
image1 - image for node without childrens; (optional)
image2 - image for closed node; (optional)
image3 - image for opened node (optional)
optionStr - options string (optional)
childs - node childs flag (for dynamical trees) (optional)
loadOpenStates(name)
[Professional]
restore open nodes from cookie
File required:dhtmlXTree_xw.js
name - optional,cookie name
loadState(name)
[Professional]
load tree from cookie
File required:dhtmlXTree_xw.js
name - optional,cookie name
moveItem(itemId,mode)
[Professional]
move item (inside of tree)
File required:dhtmlXTree.js
itemId - item Id
mode - moving mode (left,up,down)
restoreSelectedItem(name)
[Professional]
restore selected item from cookie
File required:dhtmlXTree_xw.js
name - optional, cookie name
saveOpenStates(name)
[Professional]
save open nodes to cookie
File required:dhtmlXTree_xw.js
name - optional,cookie name
saveSelectedItem(name)
[Professional]
save selected item to cookie
File required:dhtmlXTree_xw.js
name - optional, cookie name
saveState(name)
[Professional]
save tree to cookie
File required:dhtmlXTree_xw.js
name - optional, cookie name
serializeTree()
[Professional]
return xml description of tree
File required:dhtmlXTree_xw.js
setIconSize(newWidth,newHeight,itemId)
[Professional]
set size of gfx icons
File required:dhtmlXTree.js
newWidth - new icon width
newHeight - new icon height
itemId - item Id, if skipped set default value for all new icons, optional
setItemContextMenu(itemId,cMenu)
[Professional]
set context menu to individual nodes
File required:dhtmlXTree.js
itemId - node id
cMenu - context menu object
setItemStyle(itemId,style_string)
[Professional]
set individual item style
File required:dhtmlXTree.js
itemId - node id
style_string - valid CSS string
setSerializationLevel(userData,fullXML)
[Professional]
configure XML serialization
File required:dhtmlXTree_xw.js
userData - enable/disable user data serialization
fullXML - enable/disable full XML serialization
Node/level control
changeItemId(itemId,newItemId) change item id
File required:dhtmlXTree.js
itemId - old node id
newItemId - new node id
closeAllItems(itemId) collapse target node and all child nodes
File required:dhtmlXTree.js
itemId - node id
closeItem(itemId) collapse node
File required:dhtmlXTree.js
itemId - id of node
getLevel(itemId) return node level (position in hierarchy)
File required:dhtmlXTree.js
itemId - id of node
getOpenState(itemId) return open/close state
File required:dhtmlXTree.js
itemId - node id
getParentId(itemId) return parent item id
File required:dhtmlXTree.js
itemId - id of node
hasChildren(itemId) return number of childrens
File required:dhtmlXTree.js
itemId - id of node
openAllItems(itemId) expand target node and all child nodes
File required:dhtmlXTree.js
itemId - node id
openAllItemsDynamic(itemId) expand target node and all child nodes (same as openAllItems, but works in dynamic trees)
File required:dhtmlXTree_xw.js
itemId - node id, optional
openItem(itemId) expand node
File required:dhtmlXTree.js
itemId - id of node
setItemCloseable(itemId,flag) prevent node from closing
File required:dhtmlXTree.js
itemId - id of node
flag - if 0 - node can't be closed, else node can be closed