Column grouping and dynamical column hiding don't get along

Column grouping and dynamical column hiding don't get along

dbuezasdbuezas Posts: 6Questions: 0Answers: 0
edited April 2011 in Bug reports
Hi team! The library is terrific!
When I try to "Show and hide columns dynamically" in a table which has "Column grouping through col/row spans" I get the error:
Node was not found" code: "8

The bug can be reproduced by executing this:
[code] $('#example').dataTable().oTable.fnSetColumnVis( 1,false ); [/code]
(for example by adding a watch in firebug)
in:
"Column grouping through col/row spans" example

Thanks a lot for your work, you make mine easier! :)

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    This is a known limitation with DataTables 1.7 (and before). However the good news is that I've been doing some work to address that for the 1.8 release recently and it should work absolutely fine now :-). You can grab the development version of 1.8 from here: http://datatables.net/download/ .

    Regards,
    Allan
  • dbuezasdbuezas Posts: 6Questions: 0Answers: 0
    edited April 2011
    Awesome! Thanks a lot!
    One single question that I think is related:
    I wanted a table in which the first row is the classification of the second row cells, something conceptually equivalent to:
    [code]
    |-------|-------------------|----------------------|
    | (*) | Description | Name |
    |-------|-------------------|----------------------|
    | ID | Height | Weight | First | Last |
    |=======|=========|=========|======================|
    | 1 | 1.76cm | 75Kg | David | Buezas |
    | 2 | 1.86cm | 70Kg | Albert | Heinz |
    | ... | ... | ... | ... | ... |
    |-------|-------------------|----------------------|
    [/code]
    And I was able to do it, but in a somehow nasty way, I used inside the (instead of ) in the first row:
    [code]




    Description
    Name


    ID
    Height
    Weight
    First
    Last





    [/code]
    That way everything works as expected when hiding columns and it is the ID cell that gets the sorting functionality and look and not the (*)-marked cell.

    Is there a better way to do it? I am wondering if my workaround is going to work well in every scenario.

    Thanks,
    David
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    If you grab the latest nightly of DataTables 1.8.dev then that should operate as you describe (sorting on the bottom header row). Also - it should cope just fine with using all TH elements in the header - so you can change the TDs to THs.

    Allan
  • dbuezasdbuezas Posts: 6Questions: 0Answers: 0
    Yep, I came to late to report bugs :)
    Thanks!!!
This discussion has been closed.