Rowspan in Grid
There is an opportunity to set a rowspan in a grid.
You can set it in the xml and by the script (using setRowspan method).
setRowspan method has 3 parameters:
- row id
- column index
- rowspan
There is an opportunity to set a rowspan in a grid.
You can set it in the xml and by the script (using setRowspan method).
setRowspan method has 3 parameters:
<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_rowspan.js"></script> <script src="../../codebase/dhtmlxgridcell.js"></script> <table width="600px"> <tr> <td> <div id="gridbox" style="width:100%;height:270px;background-color:white;"></div> </td> </tr> <tr> <td> <input type="button" name="a1" value="row span (1)" onclick="if(mygrid.getSelectedId()){mygrid.setRowspan(mygrid.getSelectedId(),mygrid.getSelectedCellIndex(),1)} else alert('Cell is not selected !')"> <input type="button" name="a1" value="row span (2)" onclick="if(mygrid.getSelectedId()){mygrid.setRowspan(mygrid.getSelectedId(),mygrid.getSelectedCellIndex(),2)} else alert('Cell is not selected !')"> <input type="button" name="a1" value="row span (3)" onclick="if(mygrid.getSelectedId()){mygrid.setRowspan(mygrid.getSelectedId(),mygrid.getSelectedCellIndex(),3)} else alert('Cell is not selected !') "> </td></tr> </table> <script></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,100,80,80,80,80,200"); mygrid.setColAlign("right,left,left,right,center,left,center,center"); mygrid.setColTypes("dyn,edtxt,ed,price,ch,co,ra,ro"); mygrid.setColSorting("str,str,str,str,str,str,str,str"); mygrid.init(); mygrid.setSkin("dhx_skyblue"); mygrid.enableRowspan(true); mygrid.loadXML("../common/grid_rowspan.xml", function() { mygrid.setRowspan(3, 3, 3); mygrid.setRowspan(3, 2, 2); });