Loading from XML

There is an opportunity to load data from xml file or string


Reload from XML string
</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Loading from XML</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>
	<script  src="../common/data.js"></script>
	<script>
		var myGrid;
		function doOnLoad(){
			myGrid = new dhtmlXGridObject('gridbox');
			myGrid.setImagePath("../../../codebase/imgs/");
			myGrid.setHeader("Column A,Column B");
			myGrid.setInitWidths("100,*");
			myGrid.setColAlign("right,right");
			myGrid.setColTypes("ed,ed");
			myGrid.init();
			myGrid.load("php/xml.php","xml");
		}
	</script>
</head>
<body onload="doOnLoad()">
	<h1>Loading from XML</h1>
	<p>There is an opportunity to load data from xml file or string</p>
		<div id="gridbox" style="width:400px; height:350px; background-color:white;"></div>
	<br>
	<a href="javascript:void(0)" onClick="myGrid.clearAll();myGrid.parse(document.getElementById('str_xml').value);">Reload from XML string</a><br/>
	<textarea id="str_xml" style="display:none;">
		<rows>
			<row id="1">
				<cell>0</cell>
				<cell>loaded from xml string</cell>
			</row>
			<row id="2">
				<cell>1</cell>
			<cell>loaded from xml string</cell>
			</row>
			<row id="3" selected="1">
				<cell>2</cell>
				<cell>loaded from xml string</cell>
			</row>
			<row id="4">
				<cell>3</cell>
				<cell>loaded from xml string</cell>
			</row>
			<row id="5">
				<cell>4</cell>
				<cell>loaded from xml string</cell>
			</row>
			<row id="6">
				<cell>5</cell>
				<cell>loaded from xml string</cell>
			</row>
			<row id="7">
				<cell>6</cell>
				<cell>loaded from xml string</cell>
			</row>
			<row id="8">
				<cell>7</cell>
				<cell>loaded from xml string</cell>
			</row>
			<row id="9">
				<cell>8</cell>
				<cell>loaded from xml string</cell>
			</row>
			<row id="10">
				<cell>9</cell>
				<cell>loaded from xml string</cell>
			</row>
			<row id="11">
				<cell>10</cell>
				<cell>loaded from xml string</cell>
			</row>
		</rows>
	</textarea>
</body>
</html>

Documentation

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