Multiple TH in rows?

Multiple TH in rows?

doninodonino Posts: 3Questions: 0Answers: 0
edited August 2012 in General
Hi,

I am currently trying to embed datatables in a BIRT report viewer. The result is already awesome, complex headers are perfectly processed! I encounter an issue with tables wich have multiple 'TH' in rows. For example BIRT generates this kind of markup, if we have two dimensions in rows in a crosstable:

[code]








LIVRAISONS


Article


Total






Customer 1


13 déc. 2011


12


12




Customer 2


15 déc. 2011


15


12






Grand Total


256


256




[/code]

When i invoke dataTables i get: [quote] Uncaught TypeError: Cannot call method 'fnSetData' of undefined [/quote]
If i remove the second TH on each row it works. Is it known issue? Any possible workaround? Thanks!

Replies

  • doninodonino Posts: 3Questions: 0Answers: 0
    Well, i answer to myself! It appears with all my handlings in the sample file i accidentally removed 'colspan="2"' in thead and tfoot, both on the first column. Now it works, though it seems dataTables is a little bit confused by the difference of column numbers between header and rows. I get this exception:

    [quote] Uncaught TypeError: Cannot read property 'style' of undefined [/quote]

    on the line:

    [quote]
    else if ( oColumn.bVisible )
    {
    nThs[i-iCorrector].style.width = "";
    }
    [/quote]

    It does not look so bad since all features work as expected. I should be able to post a live demo link soonly if some people are interested, the combo BIRT+Datatables is amazing!
  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    Yes, the colspan=2 in the header would cause issues. DataTables can use colspan / rowspan in the header, but each column must have its own unique cell in the header so sorting etc can be applied. For example: http://datatables.net/release-datatables/examples/basic_init/complex_header.html

    > the combo BIRT+Datatables is amazing!

    Awesome :-)

    Allan
This discussion has been closed.