Configuration from JSON - DHTMLX Json

Configuration of grid can be loaded from JSON file. You need only 2-3 script commands to get the grid up and running.

Serialize grid
</> Source
<!DOCTYPE html>
<!--pro-->
<html>
<head>
	<title>Configuration from JSON - DHTMLX Json</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>
		var myGrid;
		function doOnLoad(){
			myGrid = new dhtmlXGridObject('gridbox');
			myGrid.setImagePath("../../../codebase/imgs/");
			myGrid.enableAutoWidth(true);
			myGrid.load("../common/gridConfig.json", "json");
		}
		function ser(){
			myGrid.setSerializationLevel(false,false,true);
			document.getElementById("alfa1").innerHTML=myGrid.serialize().replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\&lt;row/g,"<br/>&lt;row");
		}
	</script>
</head>
<body onload="doOnLoad()">
	<h1>Configuration from JSON - DHTMLX Json</h1>
	<p>Configuration of grid can be loaded from JSON file. You need only 2-3 script commands to get the grid up and running.</p>
	<div id="gridbox" style="width:600px; height:300px; background-color:white;"></div>
	<a href='#alfa' onClick="if(myGrid.setSerializationLevel){ser();} else {alert('Available in Pro Edition only')}">Serialize grid</a>
	<a name="alfa">
		<div id="alfa1"></div>
	</a>
</body>
</html>

Documentation

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