Unexpected number of TD elements....but neither count is the TD length

Unexpected number of TD elements....but neither count is the TD length

blartyblarty Posts: 3Questions: 0Answers: 0
edited October 2010 in General
I'm just wondering, if this issue has been fixed with the latest version of datatables...

... we have an intermittent issue when initialising datatables on an existing inplace table.

The table has 400 rows and 6 columns - but every so often the 'Unexpected TD' message comes up, and both numbers quoted as actual and expected don't match 2400.

There are no colspan's, rowspan's or conditional outputs in the code to generate the table

For example: Got 2295, expected 2298 - and then in firebug $('#mytable td').length = 2400 (Also the numbers quoted are not always the same)

Any ideas?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Not a clue I'm afraid - I've not come across this issue before. Can you post a link to an example showing the problem please. Could DataTables be being initialised before the DOM is fully loaded, which sounds like the most likely case?

    Allan
  • blartyblarty Posts: 3Questions: 0Answers: 0
    edited October 2010
    Thanks for the quick reply

    The document.ready() function containing the datatables initialiser is above the table definition in the source - would moving the function to the bottom of the source resolve this?

    I can't give you any code at the moment as I'm just away from work
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    No if it's in document.ready then that should be good enough. In which case, I'm all out of idea for why this might be happening then :-(. I think we'd need to see an example to see what might be going on.

    Allan
  • blartyblarty Posts: 3Questions: 0Answers: 0
    edited October 2010
    I'm thinking that it's due to the data size, but we don't do default sorting which is the main thing we use datatables for in this particular instance, so perhaps having a setTimeout in the document.ready() to do the datatable init may solve the issue
This discussion has been closed.