datatbles 1.7.2 bug multiples tables

datatbles 1.7.2 bug multiples tables

cbalmefrezolcbalmefrezol Posts: 11Questions: 0Answers: 0
edited September 2010 in General
Hi,

I have a bug with the new version( work fine with 1.7.1):

DataTables warning (table id = 'affichage_requete'): Unexpected number of TD elements. Expected 40 and got 160. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.
o.aoColumns[iVis] is undefined
[Break on this error] nThs[i].style.width = o.aoColumns[iVis].sWidth;

screenshot: (Last datatable have two headers! other datatables work fine!)
http://hastatis.com/data1.7.2.PNG

my datatable script:
[code]
oTable = jQuery('.affichage_requete').dataTable({
"bJQueryUI": true,
"bPaginate": false,
"aaSorting": [],
"bLengthChange": false,
"sScrollY": 250,
"sScrollX": "100%",
"sDom": '<"H"lfr<"fright ftop"ip>>t<"clear">',

"oLanguage": {
"sProcessing": "Traitement en cours...",
"sLengthMenu": "Afficher _MENU_

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Could you post your HTML as well please? There must be something which adding up for DataTables :-)

    Allan
  • cbalmefrezolcbalmefrezol Posts: 11Questions: 0Answers: 0
    edited September 2010
    [code]



    Date arr
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Your HTML isn't valid as you have multiple elements with the same ID. Each browser will treat this differently, but it is possible that some of the elements just aren't being seen - hence why it doesn't add up. Try modifying your HTML to make it valid ( http://validator.w3.org/ ) and let us know how you get on :-)

    Allan
  • cbalmefrezolcbalmefrezol Posts: 11Questions: 0Answers: 0
    edited September 2010
    I have remove ID from elements and my HTTML is now valide, but datatble not want to work correctly :(


    [code]



    Mot cle
    Immatriculatrion adversaire
    D
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Ah ha! You've found a very good bug here :-) (and :-( !).

    The problem will only show up with two tables, with different number of columns, initialised at the same time, and without an aoColumns option in the initialisation object.

    So there are a couple of workarounds possible:

    1. Use DataTables 1.7.1 - unfortunately I introduced this issue while solving something else.
    2. Initialise the two tables separately
    3. Hang about a little bit while I commit a fix and then grab the latest source. I'll post back here when committed.

    Regards,
    Allan
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I've committed a fix and unit tests for this now :-). You can grab the largest revision from here http://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js , and this will be part of the 1.7.3 release. Thanks for flagging it up!

    Regards,
    Allan
  • cbalmefrezolcbalmefrezol Posts: 11Questions: 0Answers: 0
    thank! work fine!

    Laurent
  • ileaduileadu Posts: 1Questions: 0Answers: 0
    edited September 2010
    Great!
    I meet some problem when I use datatables 1.7.2 with the 1st 3columns-table and the 2nd 2columns-table
    It shows the following fatal error :

    sData is undefined dataTables.js line: 719

    But my table is well-formatted and whole DOM also is well.

    and I use this 1.7.3 dev version.

    It's resolved.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Good to here the fix also worked for that. It was exactly the same problem, but shows up slightly differently since your first table has more columns than the second. I'll release 1.7.3 reasonably soon with this fix.

    Allan
This discussion has been closed.