Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by CHW on Mar 25, 2008 16:21
open dhtmlx forum
splitAt

HI,

I didn't get to use splitAt.

I use dhtmlXGridFromTable.

In his last suggestion:
In dhtmlxgrid_start.js you can locate and update

windowf.init();
with
windowf.init();
windowf.splitAt(1);

But it doesn't work!

My code:
mygrid = dhtmlXGridFromTable('gridbox');
' My new header (multilines)
mygrid.attachHeader("Category,Country,City,2001,#cspan,2002,#cspan,Total - net sales");
mygrid.attachHeader("#rspan,#rspan,#rspan,Gross sales,Discount,Gross sales,Discount,#rspan");
' Disabled rows - Old headers
mygrid.setRowHidden(mygrid.getRowId(0),true);
mygrid.setRowHidden(mygrid.getRowId(1),true);

I know that the first row in the Table will be the header (dhtmlXGridFromTable), but I should hide her.


Some idea to solve my problem?

Best regards,

CHW
Answer posted by Support on Mar 26, 2008 04:51
>>mygrid.setRowHidden
This command will hide the first row of dataset, not the first row of header

>>But it doesn't work!
Please check attached sample, it uses the same approach and works correctly. To simplify usage dhtmlxgrid_start.js was modified to take split position from split attribute of table.
Attachments (2)
Answer posted by CHW on Mar 26, 2008 10:12

Hi,

Thank you for his answer and example.

But to observe the values of the cells before and after the conversion. (Click on button)

1) In header Category and Country don't show.
mygrid.attachHeader("Category,Country,City,2001,#cspan,2002,#cspan,Total - net sales");
2) In detail, values in incorrect columns.
 
I made few alterations to get better:
 <table id="gridbox" split="3" style="width:400px" imgpath="../../codebase/imgs/" border="1" >
  <tr>
   <td type="ro">Category</td>
   <td>Country</td>
   <td>City</td>
   <td>Column 4</td>
   <td>Column 5</td>
   <td>Column 6</td>
   <td>Column 7</td>
   <td>Column 8</td>
  </tr>
  <tr> ......
 function doIt () {
  mygrid = dhtmlXGridFromTable('gridbox');
  mygrid.attachHeader("Category,Country,City,2001,#cspan,2002,#cspan,Total - net sales");
  mygrid.attachHeader("#rspan,#rspan,#rspan,Gross sales,Discount,Gross sales,Discount,#rspan");
  
  mygrid.setRowHidden(mygrid.getRowId(0),true);
  mygrid.setRowHidden(mygrid.getRowId(1),true);

  mygrid.hdr.deleteRow(1); // delete the first row in header

 }

Best regards,

CHW