Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Anthony Nahas on Jul 23, 2009 13:13
open dhtmlx forum
DhtmlxGrid setRowspan (combine similar rows?)

Hi, was wondering what the best way to rowspan similar rows would be?

For instance if I had a grid

123 a b c d
124 a b c d

Then abcd should be spanned between 123 and 124

Whats a good way to do this?
Answer posted by dhxSupport on Jul 24, 2009 01:20
You can do that via XML and via API (in both cases dhtmlxgrid_rowspan.js file should be attached)
XML:
<row id="1">
  <cell>123</cell>
  <cell rowspan="2">abcd</cell>
</row>
<row id="2">
  <cell>124</cell>
  <cell></cell>
</row>

Also you should add mygrid.enableRowspan(); method to the grid  initialization.

API:
mygrid.loadXML("grid.xml",function(){
  mygrid.setRowspan("1",1,2); //setRowspan() method should be called only after all rows were loaded.
 });