Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Duncan on Jun 17, 2008 03:47
open dhtmlx forum
Defining colspan in configuration via XML

Is there a method of assigning a columns colspan within the XML configuration definitions. I am creating a page where the grid headers and content are dynamically selected dependant on various database attributes. It is important that I am able to configure the grid through XML 'on the fly' and need the ability for two headers where the second includes a 'Before' and 'After' heading.
Answer posted by Support on Jun 17, 2008 05:56
Colspans in both headers and data can be defined in XML
In case of headers it done through special column label
    http://www.dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Headers_and_footers.html#grid_art_hdrftr
    http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/header_footer/pro_grid_spanheader.html

In case of data cells it can be done by colspan attribute of cell tag
    <row id="some"><cell colspan="2">...
    http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/rows_columns_manipulations/pro_colspan.html?un=1213708485000
Answer posted by Duncan on Jun 17, 2008 06:07

Thank you for your response, however the links provided do not appear to answer my question.  I wish to perform the equivalent of:

grid.setHeader("A,#cspan,#cspan")
grid.attachHeader("A1,B1,#cspan")
grid.attachHeader("#rspan,B2,C2")

but in the XML configuration.  The XML example provided does not explain the #cspan of 'A'

Answer posted by Support on Jun 17, 2008 08:23
It will look as

<rows>
    <head>
       <column type="ro" width="100">A</column>
       <column type="ro" width="100">#cspan</column>
       <column type="ro" width="100">#cspan</column>
       <afterInit>
             <call command="attachHeader"><param>A1,B1,#cspan</param></call>
             <call command="attachHeader"><param>#rspan,B2,C2</param></call>
        </afterInit>
    </head>
</rows>

setHeader mapped to rows/head/column tags
attachHeader executed from XML through head/afterInit/call tag ( basically any other grid related command can be executed in same way )