Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by rtabassum on Jan 27, 2009 23:29
open dhtmlx forum
Grid to show more number of columns than defined in header

Hi i am using grid in the application and i want something like this to be designed in the grid how can i do that

 

 

 

 

 

Growth

Billable

Billed

 

 

Pre 19th

 

 

 

 

I Inst Value

 

 

 

 

II Inst Value

 

 

 

 

III Inst Value

 

 

 

 

 

 

 

 

 

Post 19th

 

 

 

 

I Inst Value

 

 

 

 

II Inst Value

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Collection Rate for Deemed and Wet Connected Properties

 

WET

Deemed

 

Billed

Collected

Billed

Collected

Base IIIrd

 

 

 

 

Base Ivth

 

 

 

 

 

 

 

 

 

PRE 19

 

 

 

 

Growth II

 

 

 

 

Growth III

 

 

 

 

 

 

 

 

 

ALL

 

 

 

 

 

 

My xml generated runtime has 3 columns defined as header but in between of the grid i want to perform colspan and generate the table defined above... can you please suggest me and show me xml template for the above design.

Answer posted by dhxSupport on Jan 28, 2009 01:54
To use colspan at the grid first you should enable this mode:
mygrid.enableColSpan(true);
This method availble only at PRO version.

Then at the xml you set attribute colsnan="numOfCols"
<cell colspan="2">Some data</cell>
numOfCols - number of columns which you would like to merge.
Please beware that other cells, which will be included in colspan still need to be present in XML.
You can find more about grid's xml structure here http://dhtmlx.com/docs/products/docsExplorer/doc/dhtmlxxml/xmlGrid.html

for your table xml may look as

<row id="some"><cell>III Inst Value</cell><cell></cell><cell></cell></row>
<row id="some_other"><cell colspan="3" class="borderless"> </cell><cell></cell><cell></cell></row>

and in css
.borderless{
   border-right:0px solid black !important;
   border-left:0px solid black !important;
}