DHTMLX Docs & Samples Explorer

Reload with new structure

You are allowed to clear data and structure of grid and then load new data from XML file.

Reload grid with another structure
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>
<script>
dhtmlx.skin = "dhx_skyblue";
</script> <div id="gridbox" style="width:600px; height:270px; background-color:white;"></div> <a href='#alfa' onClick="ser()">Reload grid with another structure</a> <br> <script>
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../../codebase/imgs/");
mygrid.loadXML("../common/gridH.xml");
 
function ser() {
    mygrid.clearAll(true);
    mygrid.loadXML("../common/gridH3.xml");
}
</script>