DHTMLX Docs & Samples Explorer

Refresh item from server

dhtmlxTree allows you to refresh data for the specified node or group of nodes from the server.
Choose a node in the tree, press Change the text of selected item action link, then Refresh selected item from server one.

Change the text of selected item
Refresh selected item from server
 


Source
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxtree.css">
<script  src="../../codebase/dhtmlxcommon.js"></script>
<script  src="../../codebase/dhtmlxtree.js"></script>
 
 
<table>
    <tr>
        <td valign="top">
            <div id="treeboxbox_tree" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;; overflow:auto;"></div>
        </td>
        <td rowspan="2" style="padding-left:25" valign="top">
        <a href="javascript:void(0);" onClick="action_2();">Change the text of selected item</a><br>
        <a href="javascript:void(0);" onClick="action_1();">Refresh selected item from server</a><br>
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
    </tr>
</table>
<script>
tree = new dhtmlXTreeObject("treeboxbox_tree", "100%", "100%", 0);
tree.setSkin('dhx_skyblue');
tree.setImagePath("../../codebase/imgs/csh_yellowbooks/");
tree.loadXML("../common/tree.xml");
function action_1() {
    tree.refreshItems(tree.getSelectedItemId(), "../common/tree.xml");
}
function action_2() {
    tree.setItemText(tree.getSelectedItemId(), "Some trash :)");
}
</script> <br><br>