DHTMLX Docs & Samples Explorer

Subrow excell

There is a possibility to set subrows using "sub_row" excell. Try to click plus sign.

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  src="../../codebase/excells/dhtmlxgrid_excell_sub_row.js"></script>    
<style>
.even{
    background-color:#E6E6FA;
}
.uneven{
    background-color:#F0F8FF;
}
</style>
 
<div id="gridbox" style="width: 600px; height: 270px; background-color:white;"></div>
<input type="button" name="a1" value="add row" onClick="mygrid.addRow((new Date()).valueOf(),[1,2,3,4,5],1)">
<input type="button" name="a1" value="delete row" onClick="mygrid.deleteRow(mygrid.getSelectedId())">
 
<script>
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../../codebase/imgs/");
mygrid.setHeader("&nbsp;,Book,Author,Price,In Store,Shipping,Bestseller,Date");
mygrid.setInitWidths("30,140,100,80,80,80,80,70");
mygrid.setColAlign("right,left,left,right,center,left,center,center");
mygrid.setColTypes("sub_row,edtxt,ed,price,ch,co,ra,ro");
mygrid.setColSorting("na,str,str,int,int,int,na,na");
mygrid.setSkin("dhx_skyblue");
mygrid.init();
mygrid.loadXML("../common/grid_srow.xml");
</script>