Help with obscure error

Help with obscure error

dmcleandmclean Posts: 55Questions: 2Answers: 0
edited January 2012 in General
Any suggestions on what would cause something like this?

Exception calling dataTable: TypeError: h[e - d] is undefined
/devAOI/ (line 133)

Replies

  • dmcleandmclean Posts: 55Questions: 2Answers: 0
    edited January 2012
    Oops!

    I'm using 1.8.2 and several API plugins (not sure offhand which ones).

    The call itself is pretty simple:

    [code]
    oTable = $('#contextData').dataTable({
    "sScrollY":"600px",
    "bPaginate":false,
    "bSortClasses":false,
    "aoColumns":[
    { "bSortable":false },
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null
    ],
    "aaSorting":[
    [1, 'asc']
    ]
    });
    [/code]
  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    Heh - that's proper obscure!

    Nothing springs to mind from the initialisation (thanks for that), other that ensuring that you have exactly 11 columns in each row (DataTables does not support colspan / rowspan in the TBODY).

    Could you put the unminified version of DataTables into place and let me know what the error is from that? It might give a bit more of a clue as to where in the code this is happening at least!

    Regards,
    Allan
  • dmcleandmclean Posts: 55Questions: 2Answers: 0
    I checked - there are exactly 11 columns and no rowspan/colspan.

    The unminified version gives this error:

    Exception calling dataTable: TypeError: nThs[i - iCorrector] is undefined
    /devAOI/ (line 124)
  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    Thank for that - could you also check that you have 11 column headers? The error you are getting suggests that there might be less column headers than there are columns.

    DataTables requires there to be a unique column header cell for each column - basically so it can attach the sort listener to the header element for each column. colspan and rowspan are support in the header, but there must still be a unique cell for each column (i.e. no colspan).

    Allan
  • dmcleandmclean Posts: 55Questions: 2Answers: 0
    That fixed it - I had added a column but forgot the table header.

    Thank you!
This discussion has been closed.