DHTMLX Docs & Samples Explorer

Initialize object on page

You can place this JavaScript grid anywhere on your web page, attaching the grid to any object.
Set up grid parameters to determine the look of the grid. Specify whether the grid items will be loaded from XML. dhtmlxGrid uses AJAX for fast and flexible data loading.


Source
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxgrid_dhx_skyblue.css">
<script  src="../../codebase/dhtmlxcommon.js"></script>
<script  src="../../codebase/dhtmlxgrid.js"></script>        
<script  src="../../codebase/dhtmlxgridcell.js"></script>    
 
 
    <div id="gridbox" style="width:350px;height:250px;background-color:white;overflow:hidden"></div>
<br>
<script>
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../../codebase/imgs/");
mygrid.setHeader("Column A, Column B");
mygrid.setInitWidths("100,250");
mygrid.setColAlign("right,left");
mygrid.setColTypes("ro,ed");
mygrid.setColSorting("int,str");
mygrid.enableMultiselect(true);
mygrid.init();
mygrid.setSkin("dhx_skyblue");
mygrid.loadXML("../common/grid.xml");
</script>