Error if more than one row of elements inside tag

Error if more than one row of elements inside tag

norberto.ostallonorberto.ostallo Posts: 4Questions: 0Answers: 0
edited July 2010 in Bug reports
I've found a problem using DataTables. I'm using version 1.7 beta 5, but I had the same issue with v.1.6.2 and v.1.7 beta 3. I try to describe it here below.
Everything works fine in my table if I have only one row containing elements in the tag, but if I add a second row of elements (two tags inside the containing both elements) the javascript breaks reporting "a.aoColumns[b] is undefined" at line 2760:
[code]
oSettings.aoColumns[i].nTf = nTfs[i-iCorrector];
[/code]
Is this a known issue? Does DataTables have a limit of only one row of elements in a tag?

Replies

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Hi norberto.ostallo,

    Thanks for the information on this. The support that DataTables has for multiple rows in the header and the footer is fairly limited (in part because it would add a lot of code to support something which isn't used all that often). The key part where this is not supported in DataTables is in hidden columns.

    Having said that, I believe it is wrong for DataTables to be breaking like this here, and I've just put a fix in for this to my development version of DataTables. This is going to shortly be released as 1.7 beta 6. It would be a great if you could give it a go and say if works for you :-)

    Regards,
    Allan
  • norberto.ostallonorberto.ostallo Posts: 4Questions: 0Answers: 0
    Tested and perfectly working! :-)
    Thank you, you're doing a great job with datatables
  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Thank you :-). And good to hear that works well for you.

    Regards,
    Allan
  • norberto.ostallonorberto.ostallo Posts: 4Questions: 0Answers: 0
    Actually I've just found a little minor issue... :-)
    By ignoring all the lines following the fist row it results than only the first one is properly decorated (CSS/jquety ui theme applied) and all the other have no theme.
  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Ah yes - I can see that that would happen. I'd suggest a workaround for this one - just add the required class names using jQuery ( $('#example tfoot th').addClass('whatever'); ) after DataTables has finished initialising. DataTables is only really expecting a single TH element in the footer for each column - it won't interfere with the other elements, which may need some additional processing such as this.

    Regards,
    Allan
  • norberto.ostallonorberto.ostallo Posts: 4Questions: 0Answers: 0
    I will do as you suggest, thank you very much for the support!
This discussion has been closed.