Start and End of loading

Loading events occur when XML parsing starts and finishes. To test this functionality open/close nodes or refresh the tree (hardly detectable on fast connection)


</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Start and End of loading </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.setOnLoadingStart(func_a);
			myTree.setOnLoadingEnd(func_b);
			myTree.load("../common/tree.xml");
		}
		function func_a(){
			document.getElementById("b_1").style.display="";
			document.getElementById("b_2").style.display="none";
			if (document.getElementById("a_1").checked) alert("Loading start");
		}
		function func_b(){
			document.getElementById("b_2").style.display="";
			document.getElementById("b_1").style.display="none";
			if (document.getElementById("a_1").checked) alert("Loading end");
		}
	</script>
</head>
<body onload="doOnLoad()">
	<h1>XML loading events</h1>
	<p>Loading events occur when XML parsing starts and finishes. To test this functionality open/close nodes or refresh the tree (hardly detectable on fast connection)</p>
	<table>
		<tr>
			<td valign="top">
				<div id="treeboxbox_tree" class="tree_demo_samples"></div>
			</td>
			<td rowspan="2" style="padding-left:25px" valign="top">
				<input type="checkbox" id="a_1" checked><label for="a_1">Show alerts for event</label><br>
				<div style="display:none" id="b_1"><h1 style="color:red">Loading</h1></div>
				<div style="display:none" id="b_2"><h1 style="color:green">Done</h1></div>
			</td>
		</tr>
	</table>
</body>
</html>

Documentation

Check documentation to learn how to use the components and easily implement them in your applications.