expandcollaps

dhtmlXTreeObject object API

assignKeys(keys) [Professional]
configure keys used for keyboard navigation
Topic(s): Node/level control;
File required:dhtmlXTree_kn.js
  • keys - configuration array, please check samples/pro_key_nav.html for more details
  • changeItemId(itemId,newItemId)
    change item id
    Topic(s): Node/level control;
    File required:dhtmlXTree.js
  • itemId - old node id
  • newItemId - new node id
  • clearCut()
    clear cut
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
    clearSelection(itemId) [Professional]
    unselect item in tree
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • itemId - used in multi selection tree
  • closeAllItems(itemId)
    collapse target node and all child nodes
    Topic(s): Node/level control;
    File required:dhtmlXTree.js
  • itemId - node id
  • closeItem(itemId)
    collapse node
    Topic(s): Node/level control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • deleteChildItems(itemId)
    delete all children of node
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • itemId - node id
  • deleteItem(itemId,selectParent)
    delete node
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • itemId - node id
  • selectParent - If true parent of deleted item get selection, else no selected items leaving in tree.
  • disableCheckbox(itemId,mode) [Professional]
    disable checkbox
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
  • itemId - Id of tree item
  • mode - 1 - on, 0 - off;
  • disableDropCheck(mode) [Professional]
    disable parent-child check while drag and drop
    Topic(s): Initialization;
    File required:dhtmlXTree_dd.js
  • mode - 1 - on, 0 - off;
  • doCut()
    mark selected item as cutted
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
    doPaste(itemId)
    insert previously cutted branch
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • itemId - id of new parent node
  • editItem(mode) [Professional]
    enable editing of item's names
    Topic(s): Initialization;
    File required:dhtmlXTree_ed.js
  • mode - true/false
  • enableActiveImages(mode) [Professional]
    enable active images (clickable and dragable)
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - 1 - on, 0 - off;
  • enableAutoSavingSelected(mode,cookieName) [Professional]
    enable/disable autosaving selected node in cookie
    Topic(s): Add/delete;
    File required:dhtmlXTree_xw.js
  • mode - true/false
  • enableAutoTooltips(mode) [Professional]
    enable auto tooltips (node text as tooltip)
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - 1 - on, 0 - off;
  • enableCheckBoxes(mode)
    hide checkboxes (all checkboxes in tree)
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - enabled/disabled
  • enableContextMenu(menu) [Professional]
    enable context menu
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • menu - dhtmlXmenu object
  • enableDistributedParsing(mode,count,delay) [Professional]
    enable distributed parsing of long items list
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • mode - true/false
  • count - critical count to start distibuting (optional)
  • delay - delay between distributed calls, ms (optional)
  • enableDragAndDrop(mode,rmode)
    enable/disable drag-and-drop
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • 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 ]
  • rmode - enabled/disabled drag and drop on super root
  • enableDragAndDropScrolling(mode) [Professional]
    enable/disable auto scrolling while drag-and-drop
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - enabled/disabled
  • enableHighlighting(mode) [Professional]
    enable item highlighting (item text highlited on mouseover)
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - 1 - on, 0 - off;
  • enableImageDrag(mode)
    create enable draging of item image with item text
    Topic(s): Selection control;
    File required:dhtmlXTree.js
  • mode - true/false
  • enableItemEditor(mode) [Professional]
    enable editing of item's names
    Topic(s): Initialization;
    File required:dhtmlXTree_ed.js
  • mode - true/false
  • enableKeyboardNavigation(mode) [Professional]
    enable keyboard navigation in tree
    Topic(s): Node/level control;
    File required:dhtmlXTree_kn.js
  • mode - true/false
  • enableMercyDrag(mode) [Professional]
    enable drag without removing (copy instead of move)
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - 1 - on, 0 - off;
  • enableMultiLineItems(width) [Professional]
    enable multi line items
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • width - text width, if equls zero then use single lines items;
  • enableMultiselection(mode,strict) [Professional]
    enable multiselection
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - 1 - on, 0 - off;
  • strict - 1 - on, 0 - off; in strict mode only items on the same level can be selected
  • enableRadioButtons(itemId,mode)
    replace checkboxes with radio buttons
    Topic(s): Selection control;
    File required:dhtmlXTree.js
  • mode - true/false
  • itemId - node for which replacement called (optional)
  • enableRTL(mode) [Professional]
    return xml description of tree
    Topic(s): Add/delete;
    File required:dhtmlXTree_rl.js
  • mode - true/false
  • enableSmartCheckboxes(mode) [Professional]
    enable smart checkboxes ,true by default (auto checking childs and parents for 3-state checkboxes)
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - 1 - on, 0 - off;
  • enableSmartXMLParsing(mode) [Professional]
    enable/disable smart XML parsing mode (usefull for big, well structured XML)
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - 1 - on, 0 - off;
  • enableTextSigns(mode)
    replace images with text signs
    Topic(s): Selection control;
    File required:dhtmlXTree.js
  • mode - true/false
  • enableThreeStateCheckboxes(mode)
    enable three state checkboxes
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - 1 - on, 0 - off;
  • enableTreeImages(mode)
    enable tree images
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - 1 - on, 0 - off;
  • enableTreeLines(mode)
    enable/disable tree lines (parent-child threads)
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • mode - enable/disable tree lines
  • findItem(searchStr,direction,top) [Professional]
    find tree item by text, select and focus it
    Topic(s): Add/delete;
    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
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • searchStr - search text
  • direction - 0: top -> bottom; 1: bottom -> top
  • top - 1: start searching from top
  • focusItem(itemId) [Professional]
    focus item in tree
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • itemId - item Id
  • getAllChecked()
    return list of identificators of nodes with checked checkboxes, separated by comma
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
    getAllCheckedBranches()
    return list of identificators of nodes with checked and third state checkboxes, separated by comma
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
    getAllFatItems() [Professional]
    Returns the list of all items which has child nodes, separated by commas.
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
    getAllLeafs() [Professional]
    Returns the list of all items which don't have child nodes.
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
    getAllPartiallyChecked() [Professional]
    return list of identificators of nodes with third state checkboxes, separated by comma
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
    getAllSubItems(itemId)
    Returns the list of all children items from all next levels of tree, separated by commas.
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • getAllUnchecked(itemId) [Professional]
    return list of identificators of nodes with unchecked checkboxes, separated by comma
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
    getChildItemIdByIndex(itemId,index)
    retun child node id by index
    Topic(s): Selection control;
    File required:dhtmlXTree.js
  • itemId - parent node id
  • index - index of child node
  • getDistributedParsingState() [Professional]
    get current state of distributed parsing
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
    Returns:true - still parsing; false - parsing finished
    getIndexById(itemId)
    retun node index in childs collection by Id
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • itemId - node id
  • getItemColor(itemId)
    get node color
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • getItemIdByIndex(itemId,index)
    retun node id by index
    Topic(s): Selection control;
    File required:dhtmlXTree.js
  • itemId - parent node id
  • index - index of node, 0 based
  • getItemImage(itemId,imageInd,fullPath) [Professional]
    get source of item's image
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • itemId - id of item
  • imageInd - index of image ( 0 - leaf, 1 - closed folder, 2 - opened folder)
  • value - value of top offset
  • getItemParsingState(itemId) [Professional]
    get current parsing state of item
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
    Returns:1 - item already parsed; 0 - item not parsed yet; -1 - item in parsing process
    getItemText(itemId)
    return item text
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • getLevel(itemId)
    return node level (position in hierarchy)
    Topic(s): Node/level control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • getOpenState(itemId)
    return open/close state
    Topic(s): Node/level control;
    File required:dhtmlXTree.js
  • itemId - node id
  • getParentId(itemId)
    return parent item id
    Topic(s): Node/level control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • getSelectedItemId()
    retun selected item id

    File required:dhtmlXTree.js
    getSelectedItemId()
    retun selected item id
    Topic(s): Selection control;
    File required:dhtmlXTree.js
    getSelectedItemText()
    retun selected node text
    Topic(s): Selection control;
    File required:dhtmlXTree.js
    getSubItems(itemId)
    Returns the list of all children items from the next level of tree, separated by commas.
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • getUserData(itemId,name)
    return user data from target node
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
  • itemId - target node id
  • name - key for user data
  • getXMLState() [Professional]
    return current state of XML loading
    Topic(s): Initialization;
    File required:dhtmlXTree.js
    hasChildren(itemId)
    return number of childrens
    Topic(s): Node/level control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • insertNewChild(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs)
    create new node as a child to specified with parentId
    Topic(s): Add/delete;
    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)
  • insertNewNext(itemId,newItemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs)
    create new node next to specified
    Topic(s): Add/delete;
    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)
  • isItemChecked(itemId)
    return state of nodes's checkbox
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
  • itemId - target node id
  • isLocked(itemId) [Professional]
    return locked state of item
    Topic(s): Node/level control;
    File required:dhtmlXTree_li.js
  • itemId - id of item

  • Returns:true/false - locked/unlocked
    loadOpenStates(name) [Professional]
    restore open nodes from cookie
    Topic(s): Add/delete;
    File required:dhtmlXTree_xw.js
  • name - optional,cookie name
  • loadState(name) [Professional]
    load tree from cookie
    Topic(s): Add/delete;
    File required:dhtmlXTree_xw.js
  • name - optional,cookie name
  • loadXML(file,afterCall)
    load tree from xml file
    Topic(s): Initialization;
    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
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • xmlString - XML string
  • afterCall - function which will be called after xml loading
  • lockItem(itemId,state) [Professional]
    lock/unlock item
    Topic(s): Node/level control;
    File required:dhtmlXTree_li.js
  • itemId - id of item
  • state - true/false - lock/unlock item
  • moveItem(itemId,mode,targetId,targetTree) [Professional]
    move item (inside of tree)
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • itemId - item Id
  • mode - moving mode (left,up,down,item_child,item_sibling)
  • targetId - target Node in item_child and item_sibling mode
  • targetTree - used for moving between trees (optional)
  • openAllItems(itemId)
    expand target node and all child nodes
    Topic(s): Node/level control;
    File required:dhtmlXTree.js
  • itemId - node id
  • openAllItemsDynamic(itemId) [Professional]
    expand target node and all child nodes (same as openAllItems, but works in dynamic trees)
    Topic(s): Node/level control;
    File required:dhtmlXTree_xw.js
  • itemId - node id, optional
  • openItem(itemId)
    expand node
    Topic(s): Node/level control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • openItemsDynamic(list,flag) [Professional]
    expand list of nodes in dynamic tree (wait of loading of node before expanding next)
    Topic(s): Node/level control;
    File required:dhtmlXTree_xw.js
  • list - list of nodes which will be expanded
  • flag - true/false - select last node in the list
  • openOnItemAdding(mode) [Professional]
    configure if parent node will be expanded immideatly after child item adding
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • mode - true/false
  • refreshItem(itemId)
    refresh tree branch from xml (XML with description of child nodes rerequested from server)
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - id of node, if not defined tree super root used.
  • refreshItems(itemIdList,source) [Professional]
    refresh specified tree nodes (get XML from server and updat only nodes included in itemIdList)
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemIdList - list of node identificators
  • source - server side script
  • restoreSelectedItem(name) [Professional]
    restore selected item from cookie
    Topic(s): Add/delete;
    File required:dhtmlXTree_xw.js
  • name - optional, cookie name
  • saveOpenStates(name,cookie_param) [Professional]
    save open nodes to cookie
    Topic(s): Add/delete;
    File required:dhtmlXTree_xw.js
  • name - optional,cookie name
  • cookie_param - additional parametrs added to cookie
  • saveSelectedItem(name,cookie_param) [Professional]
    save selected item to cookie
    Topic(s): Add/delete;
    File required:dhtmlXTree_xw.js
  • name - optional, cookie name
  • cookie_param - additional parametrs added to cookie
  • saveState(name,cookie_param) [Professional]
    save tree to cookie
    Topic(s): Add/delete;
    File required:dhtmlXTree_xw.js
  • name - optional, cookie name
  • cookie_param - additional parametrs added to cookie
  • selectItem(itemId,mode,preserve)
    select node ( and optionaly fire onselect event)
    Topic(s): Selection control;
    File required:dhtmlXTree.js
  • itemId - node id
  • mode - If true, script function for selected node will be called.
  • preserve - preserve earlie selected nodes
  • serializeTree() [Professional]
    return xml description of tree
    Topic(s): Add/delete;
    File required:dhtmlXTree_xw.js
    setCheck(itemId,state)
    change state of node's checkbox
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
  • itemId - target node id
  • state - checkbox state (0/1/unsure)
  • setChildCalcHTML( htmlA,htmlB ) [Professional]
    set child calculation prefix and postfix
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • htmlA - postfix ([ - by default)
  • htmlB - postfix (] - by default)
  • setChildCalcMode( mode ) [Professional]
    set child calculation mode
    Topic(s): Initialization;
    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)
  • setCustomSortFunction(func) [Professional]
    set custom sort functions, which has two parametrs - id_of_item1,id_of_item2
    Topic(s): Initialization;
    File required:dhtmlXTree_sb.js
  • func - sorting function
  • setDragBehavior(mode) [Professional]
    set Drag-And-Drop behavior (child - drop as chils, sibling - drop as sibling, complex - complex drop behaviour )
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - behavior name (child,sibling,complex)
  • setDragHandler(func)
    set function called when drag-and-drop event occured

    EventName:onDrag
    Event occured after item was dragged and droped on another item, but before item moving processed.
  • ID of source item
  • ID of target item
  • if node droped as sibling then contain id of item before whitch source node will be inserted
  • source Tree object
  • target Tree object

  • Event returns:true - confirm drag-and-drop; false - deny drag-and-drop;
    Topic(s): Initialization; Event Handlers;
    File required:dhtmlXTree.js
  • aFunc - event handling function
  • setDropHandler(func) [Professional]
    set function called after drag-and-drap event occured

    EventName:onDrop
    Event raised after drag-and-drop processed. Event also raised while programmatic moving nodes.
  • ID of source item
  • ID of target item
  • Topic(s): Initialization; Event Handlers;
    File required:dhtmlXTree.js
  • func - event handling function
  • setEditStartAction(click_IE, dblclick) [Professional]
    define which events must start editing
    Topic(s): Initialization;
    File required:dhtmlXTree_ed.js
  • click_IE - click on already selected item - true/false [true by default]
  • dblclick - click on already selected item - true/false [true by default]
  • setEscapingMode(mode) [Professional]
    set escaping mode (used for escaping ID in server requests)
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • mode - escaping mode ("utf8" for UTF escaping)
  • setIconSize(newWidth,newHeight,itemId) [Professional]
    set size of gfx icons
    Topic(s): Add/delete;
    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
  • setImageArrays(arrayName,image1,image2,image3,image4,image5)
    set images used for parent-child threads drawing
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • arrayName - name of array: plus, minus
  • image1 - line crossed image
  • image2 - image with top line
  • image3 - image with bottom line
  • image4 - image without line
  • image5 - single root image
  • setImagePath( newPath )
    set path to image directory
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • newPath - path to image directory
  • setItemCloseable(itemId,flag)
    prevent node from closing
    Topic(s): Node/level control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • flag - if 0 - node can't be closed, else node can be closed
  • setItemColor(itemId,defaultColor,selectedColor)
    set node color
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • defaultColor - node color
  • selectedColor - selected node color
  • setItemContextMenu(itemId,cMenu) [Professional]
    set context menu to individual nodes
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • itemId - node id
  • cMenu - context menu object
  • setItemImage(itemId,image1,image2)
    set item images
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • image1 - node without childrens image or closed node image (if image2 specified)
  • image2 - open node image (optional)
  • setItemImage2(itemId, image1,image2,image3)
    set item images
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • image1 - node without childrens image
  • image2 - closed node image
  • image3 - open node image
  • setItemStyle(itemId,style_string) [Professional]
    set individual item style
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • itemId - node id
  • style_string - valid CSS string
  • setItemText(itemId,newLabel,newTooltip)
    set new node text (HTML allowed)
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - id of node
  • newLabel - node text
  • newTooltip - (optional)tooltip for the node
  • setItemTopOffset(itemId,value) [Professional]
    set top offset for item
    Topic(s): Add/delete;
    File required:dhtmlXTree.js
  • itemId - id of item
  • value - value of top offset
  • setListDelimeter(separator) [Professional]
    set list separator (comma by default)
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • separator - char or string using for separating items in lists
  • setLockedIcons(im0,im1,im2) [Professional]
    set icon for locked items
    Topic(s): Node/level control;
    File required:dhtmlXTree_li.js
  • im0 - icon for locked leaf
  • im1 - icon for closed branch
  • im2 - icon for opened branch
  • setOnCheckHandler(func)
    set function called before checkbox checked/unchecked

    EventName:onCheck
    Event raised immideatly after item in tree was checked/unchecked.
  • ID of item which will be checked/unchecked
  • Current checkbox state. 1 - item checked, 0 - item unchecked.
  • Topic(s): Initialization; Event Handlers;
    File required:dhtmlXTree.js
  • func - event handling function
  • setOnClickHandler(func)
    set function called when tree node selected

    EventName:onClick
    Event raised immideatly after text part of item in tree was clicked, but after default onClick functionality was processed.
  • ID of clicked item
  • Topic(s): Initialization; Event Handlers;
    File required:dhtmlXTree.js
  • func - event handling function
  • setOnDblClickHandler(func)
    set function called when tree node double clicked

    EventName:onDblClick
    Event raised immideatly after item in tree was doubleclicked, before default onDblClick functionality was processed.
  • ID of item which was doubleclicked

  • Event returns:true - confirm opening/closing; false - deny opening/closing;
    Topic(s): Initialization; Event Handlers;
    File required:dhtmlXTree.js
  • func - event handling function
  • setOnDragIn(func) [Professional]
    set function called when tree item draged over another item

    EventName:onDragIn
    Event raised when item draged other other dropable target
  • ID draged item
  • ID potencial drop landing
  • source object
  • target object

  • Event returns:true - allow drop; false - deny drop;
    Topic(s): Node/level control;
    File required:dhtmlXTree_dd.js
  • func - event handling function
  • setOnEditHandler(func) [Professional]
    set onEdit handler

    EventName:onEdit
    Event occurs on 4 different stages of edit process: before editing started (cancelable), after editing started, before closing (cancelable), after closed
  • state - 0 before editing started , 1 after editing started, 2 before closing, 3 after closed
  • id - id of edited items
  • tree - tree object
  • value - for stage 0 and 2, value of editor

  • Event returns:for stages 0 and 2; true - confirm opening/closing, false - deny opening/closing; text - edit value
    Topic(s): Initialization;
    File required:dhtmlXTree_ed.js
  • func - function which will be called on edit related events
  • setOnLoadingEnd(func) [Professional]
    set function called after xml loading/parsing ended

    EventName:onXMLLoadingEnd
    event fired simultaneously with ending XML parsing, new items already available in tree
  • tree object
  • last parsed parent id
  • Topic(s): Initialization; Event Handlers;
    File required:dhtmlXTree.js
  • func - event handling function
  • setOnLoadingStart(func) [Professional]
    set function called before xml loading/parsing started

    EventName:onXMLLoadingStart
    event fired simultaneously with starting XML parsing
  • tree object
  • item id, for which xml loaded
  • Topic(s): Initialization; Event Handlers;
    File required:dhtmlXTree.js
  • func - event handling function
  • setOnOpenEndHandler(func)
    set function called after tree node opened/closed

    EventName:onOpenEnd
    Event raised immideatly after item in tree got command to open/close , and before item was opened//closed. Event also raised for unclosable nodes and nodes without open/close functionality - in that case result of function will be ignored.
  • ID of node which will be opened/closed
  • Current open state of tree item. 0 - item has not childs, -1 - item closed, 1 - item opened.
  • Topic(s): Initialization; Event Handlers;
    File required:dhtmlXTree.js
  • func - event handling function
  • setOnOpenStartHandler(func)
    set function called before tree node opened/closed

    EventName:onOpenStart
    Event raised immideatly after item in tree got command to open/close , and before item was opened//closed. Event also raised for unclosable nodes and nodes without open/close functionality - in that case result of function will be ignored.
  • ID of node which will be opened/closed
  • Current open state of tree item. 0 - item has not childs, -1 - item closed, 1 - item opened.

  • Event returns:true - confirm opening/closing; false - deny opening/closing;
    Topic(s): Initialization; Event Handlers;
    File required:dhtmlXTree.js
  • func - event handling function
  • setOnRightClickHandler(func)
    set function called when tree node selected

    EventName:onRightClick
    Event occured after right mouse button was clicked.
  • ID of clicked item
  • Topic(s): Initialization; Event Handlers;
    File required:dhtmlXTree.js
  • func - event handling function
  • setSerializationLevel(userData,fullXML,escapeEntities,userDataAsCData) [Professional]
    configure XML serialization
    Topic(s): Add/delete;
    File required:dhtmlXTree_xw.js
  • userData - enable/disable user data serialization
  • fullXML - enable/disable full XML serialization
  • escapeEntities - convert tag brackets to related html entitites
  • userDataAsCData - output user data in CDATA sections
  • setStdImages(image1,image2,image3)
    set default images for nodes (must be called before XML loading)
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • a0 - image for node without childrens;
  • a1 - image for closed node;
  • a2 - image for opened node
  • setSubChecked(itemId,state)
    change state of node's checkbox and all childnodes checkboxes
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
  • itemId - target node id
  • state - checkbox state
  • setUserData(itemId,name,value)
    set user data for target node
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
  • itemId - target node id
  • name - key for user data
  • value - user data
  • setXMLAutoLoading(filePath)
    enables dynamic loading from XML
    Topic(s): Initialization;
    File required:dhtmlXTree.js
  • filePath - name of script returning XML; in case of virtual loading - user defined function
  • setXMLAutoLoadingBehaviour(mode) [Professional]
    define which script be called on dynamic loading
    Topic(s): Selection control;
    File required:dhtmlXTree.js
  • mode - id for some_script?id=item_id ; name for some_scriptitem_id, xmlname for some_scriptitem_id.xml ; function for calling user defined handler
  • showItemCheckbox(itemId,state) [Professional]
    show/hide checkbox for tree item (work only for individual items, not for all tree )
    Topic(s): Checkboxes/user data manipulation;
    File required:dhtmlXTree.js
  • itemId - id of selected item
  • state - checkbox show state : 0/1
  • showItemSign(itemId,state) [Professional]
    show/hide (+/-) icon (work only for individual items, not for all tree )
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - id of selected item
  • state - show state : 0/1
  • sortTree(nodeId,order,all_levels) [Professional]
    reorder items in tree
    Topic(s): Initialization;
    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
  • updateItem(itemId,name,im0,im1,im2,achecked) [Professional]
    update item properties
    Topic(s): Appearence control;
    File required:dhtmlXTree.js
  • itemId - list of node identificators
  • name - list of node identificators, optional
  • im0 - list of node identificators, optional
  • im1 - list of node identificators, optional
  • im2 - list of node identificators, optional
  • achecked - list of node identificators, optional