DHTMLX Docs & Samples Explorer

Refreshing Items

Delete Selected Node
Set selected Node Lable to

Refresh Item and the entire tree from server

These operations get tree structure (of the entire tree or starting from the specified level) from server to syncronize client and server nodes.
Refresh selected Item
Refresh root (Entire tree)

Refresh Item in the smart mode

Refreshing items in the smart mode keeps opened and selected items state when it is possible.
Refresh selected Item (smart mode)
Source
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxtree.css">
<script  src="../../codebase/dhtmlxcommon.js"></script>
<script  src="../../codebase/dhtmlxtree.js"></script>
 
 
<script>
var tree;
function doOnLoad() {
    tree = new dhtmlXTreeObject("treeboxbox_tree", "100%", "100%", 0);
    tree.setSkin('dhx_skyblue');
    tree.setImagePath("../../codebase/imgs/csh_winstyle/");
    tree.enableDragAndDrop(true);
    tree.setXMLAutoLoadingBehaviour("id");
    tree.setChildCalcMode("child");
    tree.setXMLAutoLoading("php/xml.php");
    tree.enableSmartXMLParsing(true);
    tree.loadXML("php/xml.php");
}
</script> <div id="treeboxbox_tree" style="width:260px;height:200px;float:left"></div> <div style="height:200px;"> <a href="#" onClick="tree.deleteItem(tree.getSelectedItemId(),true)">Delete</a> Selected Node<br> <a href="#" onClick="tree.setItemText(tree.getSelectedItemId(),document.getElementById('newlabel').value)">Set</a> selected Node Lable to <input id="newlabel"> </div> <div> These operations get tree structure (of the entire tree or starting from the specified level) from server to syncronize client and server nodes. <br> <a href="javascript:void(0)" onClick="tree.refreshItem(tree.getSelectedItemId())">Refresh selected Item</a> <br> <a href="javascript:void(0)" onClick="tree.refreshItem(0)">Refresh root (Entire tree)</a> </div> Refreshing items in the smart mode keeps opened and selected items state when it is possible. <br> <a href="javascript:void(0)" onClick="tree.smartRefreshItem(tree.getSelectedItemId())">Refresh selected Item (smart mode)</a>