Loading from xml string
dhtmlxTree supports loading tree structure from an xml string.
</> Source
<!DOCTYPE html>
<!--pro-->
<html>
<head>
<title>Loading from xml string</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
<script src="../../../codebase/dhtmlx.js"></script>
<link rel="stylesheet" type="text/css" href="../common/demo_style.css"/>
<script>
var myTree;
function doOnLoad(){
myTree = new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);
myTree.setImagePath("../../../skins/web/imgs/dhxtree_web/");
myTree.enableSmartXMLParsing(true);
myTree.enableCheckBoxes(true);
myTree.enableDragAndDrop(true);
myTree.enableThreeStateCheckboxes(true);
var xml = '<?xml version="1.0" encoding="iso-8859-1" ?><tree id="0"><item text="Briari\'s" id="1"></item></tree>';
myTree.parse('<?xml version="1.0" encoding="iso-8859-1"?><tree id="0"><item text="Lawrence Block" id="t2_lb"><item text="All the Flowers Are Dying" id="lb_1"/><item text="The Burglar on the Prowl" id="lb_2"/><item text="The Plot Thickens" id="lb_3"/><item text="Grifter Game" id="lb_4"/><item text="The Burglar Who Thought He Was Bogart" id="lb_5"/></item><item text="Robert Crais" id="t2_rc" open="1"><item text="The Forgotten Man" id="rc_1"/><item text="Stalking the Angel" id="rc_2"/><item text="Free Fall" id="rc_3"/> <item text="Sunset Express" id="rc_4"/> <item text="Hostage" id="rc_5"/></item><item text="Dan Brown" id="t2_db"> <item text="Angels & Demons" id="db_1"/><item text="Deception Point" id="db_2"/><item text="Digital Fortress" id="db_3"/><item text="The Da Vinci Code" id="db_4"/><item text="Deception Point" id="db_5"/></item><item text="Joss Whedon" id="t2_jw"><item text="Astonishing X-Men" id="jw_1"/><item text="Joss Whedon: The Genius Behind Buffy" id="jw_2"/><item text="Fray" id="jw_3"/><item text="Tales Of The Vampires" id="jw_4"/><item text="The Harvest" id="jw_5"/></item></tree>');
}
</script>
</head>
<body onload="doOnLoad()">
<h1>Loading from xml string</h1>
<p>dhtmlxTree supports loading tree structure from an xml string.</p>
<div id="treeboxbox_tree" class="tree_demo_samples"></div>
</body>
</html>
Documentation
Check documentation to learn how to use the components and easily implement them in your applications.