DHTMLX Docs & Samples Explorer

Smart Rendering and colspan

You are allowed to enable both smart rendering and colspan modes in your grid.

Loading data
Select row with id=r36; mygrid.setSelectedRow("r36");
Select row with id=r72; mygrid.setSelectedRow("r72");
THIS PAGE CONTAINS SAMPLE FUNCTIONALITY OF PROFESSIONAL EDITION FOR DEMONSTRATION PURPOSE ONLY.
UNAUTHORIZED USE IS PROHIBITED. PLEASE CONTACT SALES@DHTMLX.COM TO OBTAIN A LEGAL COPY OF PROFESSIONAL EDITION.
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/ext/dhtmlxgrid_srnd.js"></script>
<script  src="../../codebase/dhtmlxgridcell.js"></script>
 
 
 
 
<div style="height:20px;">
    <div id="a_1" style="color:red;">Loading data</div>
</div>
<div id="gridbox" style="width:600px; height:250px; background-color:white;overflow:hidden"></div>
<a href="javascript:void(0)" onClick="mygrid.setSelectedRow('r36');">Select row with id=r36; mygrid.setSelectedRow("r36");</a><br/>
<a href="javascript:void(0)" onClick="mygrid.setSelectedRow('r72');">Select row with id=r72; mygrid.setSelectedRow("r72");</a><br/>
<script>
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../../codebase/imgs/");
mygrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
mygrid.setInitWidths("50,150,120,80,80,80,80,200");
mygrid.setColAlign("right,left,left,right,center,left,center,center");
mygrid.setColTypes("ed,ed,ed,price,ch,co,ro,ro");
mygrid.enableCollSpan(true);
mygrid.getCombo(5).put(2, 2);
mygrid.setColSorting("int,str,str,int,str,str,str,date");
 
mygrid.attachEvent("onXLS", function() {
    document.getElementById("a_1").style.display = "block";
});
mygrid.attachEvent("onXLE", function() {
    document.getElementById("a_1").style.display = "none";
});
mygrid.init();
mygrid.setSkin("dhx_skyblue");
mygrid.enableSmartRendering(true);
mygrid.loadXML("../common/smartrend_cl.xml");
</script>