I am using DHTMLXGrid on a page where the data is generated dynamically. The other technologies involved are Java/J2EE and Struts. I display an HTML table in the proper fashion and then convert it into a DHTMLXGrid using dhtmlXGridFromTable() passing the id of the table as the argument.
This table has multiple header rows with each having different colspan values. The grid does not respect this and shows the grid with as many columns as the first row resulting in loss of columns which are displayed in the HTML table. I tried differnt approaches. I tried to use a hidden field having the header column values and using attachHeader(). This resulted in an incorrect diplay.
Any suggestion / solution for this problem? We are also facing exact similar problem.
Please some one help us on this.
Thanks in advance.
While generating grid from html table only first table’s row treated as grid’s header. If you need to merge 2 columns in the grid header, first table row should looks like that:
<table id="tblToGrid" name="grid1" gridHeight="auto" onbeforeinit="doOnBeforeInit()" style="width:400px" imgpath="../codebase/imgs/" border="1" lightnavigation="true">
<td type="ro">Column 1</td>
If you need to add more header rows, you should call attachHeader() method before grid initialization: