Possible Issue with colspan only header

Possible Issue with colspan only header

FergusFergus Posts: 2Questions: 0Answers: 0
edited July 2012 in Bug reports
Javascript error when table header consists of data with colspan? OR am I doing something seriously wrong?

[code]
<!DOCTYPE html>









// When the document loads do everything inside here ...
$(document).ready(function(){

$('#maplegend').dataTable();
alert("hmmm");
});






Legend

<!-- uncomment the following to get rid of error -->
<!-- tr>
Col1
Col2



Name1Value1
Name2Value2
Name3Value3
Name4Value4
Name5Value5




[/code]

Here the javascript alert will never pop up!
However, if you uncomment out the second set of tr/th combination, alert box pops up. At times, IE shows the following error

[quote]
SCRIPT5007: Unable to get value of the property 'asSorting': object is null or undefined
jquery.dataTables.js, line 6542 character 16
[/quote]

but mostly the error is eaten up.


Thank you

Replies

  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    You must have a cell for every column in the table. It can have rowspan on it, but there must be at least one cell for each column that will uniquely identify that column. Otherwise, DataTables doesn't have any way to let you apply sorting to that individual column - and this is also how DataTables knows how many columns there are in a table.

    Allan
  • FergusFergus Posts: 2Questions: 0Answers: 0
    Got it. Thanks again.
This discussion has been closed.