Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by DJay on Dec 04, 2009 12:47
open dhtmlx forum
How can I use colspan on column header when loading grid column headers and data from XML.

How can I use colspan on column header when loading grid column header and data from XML.

I am trying something like below, but does not seems to work.

<rows>
  <head>
  <column width="20" type="ro" align="left" sort="str">Wire Code</column>
  <column width="20" type="ro" align="left" sort="str">Org. Name</column>
  
  <column width="20" type="combo_v" editable="false" align="left" sort="str" xmlcontent="1">Status **
   <option value="IN USE">IN USE</option>
      <option value="AVAILABLE">AVAILABLE</option>
   <option value="CLEANSING">CLEANSING</option>
      <option value="RESTRICTED (DO NOT USE)">RESTRICTED (DO NOT USE)</option>
        </column>
        <column width="20" format="%m/%d/%Y" type="dhxCalendar" align="left" sort="str"  >Effective Date **</column>
        <column width="10" type="link" align="left" sort="str" colspan="2" >Action</column>
        <column> </column>
  
  <settings>
            <colwidth>%</colwidth>
        </settings>
       
    </head>

  <row id="1001">
  <cell>KB</cell>
  <cell>Manchester, NH</cell>
  <cell>IN USE</cell>
  <cell>05/01/1998</cell>
  <cell>History ^javascript:alert("history");</cell>
  <cell>Update</cell>
 </row>
 <row id="1002">
  <cell>AY</cell>
  <cell>ADMIN DIVISION</cell>
  <cell>IN USE</cell>
  <cell>01/01/2000</cell>
  <cell >History ^javascript:alert("history");^_self;</cell>
  <cell>Update</cell>
 </row>
</rows> 

 

Also is there a way so that I can call more than one javascript functions on different texts in cells?

e.g. something like below

<cell>HISTORY^javascript:alert("history");   UPDATE^javascript:alert("update");</cell>
 

 

 

Answer posted by dhxSupport on Dec 07, 2009 01:40
To merge 2 cells in the header you should use:

<column width="10" type="link" align="left" sort="str" >Action</column>
  <column width="10">#cspan</column>

To merge cells in the rows you should use "cspan" cell's attribute. Please find more information here http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:cells_manipulation#merging_cells
Answer posted by dhxSupport on Dec 07, 2009 01:41
>>Also is there a way so that I can call more than one javascript functions on different texts in cells?
It's impossible to do with "link" eXcell type. You can create custom eXcell type http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:toc_custom_excell_creation
Answer posted by DJay on Dec 07, 2009 07:11
Thank You.