Loading from JS array

You can load grid data from JS array.


Reload from JS array object
</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Loading from JS array</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("Sales, Book Title, Author");
			myGrid.setInitWidths("70,250,*");
			myGrid.setColAlign("right,left,left");
			myGrid.setColTypes("dyn,ed,ed");
			myGrid.setColSorting("int,str,str");
			myGrid.init();
			myGrid.load("../common/_data.js","jsarray");
		}
	</script>
</head>
<body onload="doOnLoad()">
	<h1>Loading from JS array</h1>
	<p>You can load grid data from JS array.</p>
	<div id="gridbox" style="width:500px; height:350px; background-color:white;"></div>
	<br>
	<a href="javascript:void(0)" onclick='myGrid.clearAll(); alert("old data cleared\nloading new one..."); myGrid.parse(data,"jsarray");'>Reload from JS array object</a>
</body>
</html>

Documentation

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