DHTMLX Docs & Samples Explorer

Smart Parsing

Smart parsing can increase performance of the TreeGrid control when you have a lot of nodes and levels in it.
Current sample demonstrates loading of 1700 nodes on 4 levels. There is no need to change anything on server side.


Enabling Smart XML Parsing with script
Source
<link rel="STYLESHEET" type="text/css" href="../../../dhtmlxGrid/codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="../../../dhtmlxGrid/codebase/skins/dhtmlxgrid_dhx_skyblue.css">
<script  src="../../../dhtmlxGrid/codebase/dhtmlxcommon.js"></script>
<script  src="../../../dhtmlxGrid/codebase/dhtmlxgrid.js"></script>
<script  src="../../../dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>
<script  src="../../codebase/dhtmlxtreegrid.js"></script>
 
<script>
var mygrid;
function doOnLoad() {
    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.selMultiRows = true;
    mygrid.imgURL = "../../../dhtmlxGrid/codebase/imgs/icons_greenfolders/";
    mygrid.setHeader("Car,Mileage,Volume,State A,State B");
    mygrid.setInitWidths("*,100,80,60,60");
    mygrid.setColAlign("left,left,left,center,center");
    mygrid.setColTypes("tree,ed,txt,ch,ch");
    mygrid.setColSorting("str,str,str,na,str");
    mygrid.enableCollSpan(true);
    mygrid.enableSmartXMLParsing(true);
    mygrid.setSkin("dhx_skyblue");
    mygrid.init();
    mygrid.loadXML("php/tree_grid.php");
}
</script> <div id="gridbox" width="600px" height="200px"></div> <br> Enabling Smart XML Parsing with script