Bug in _fnGetUniqueThs (jquery.dataTables.js 1.9.4). Column with wrong Th

Bug in _fnGetUniqueThs (jquery.dataTables.js 1.9.4). Column with wrong Th

lukeTNlukeTN Posts: 1Questions: 0Answers: 0
edited February 2013 in Bug reports
_fnGetUniqueThs (jquery.dataTables.js 1.9.4) does not retrieve a list of only TH elements, but returns the elements of the lastest row (even if the last row is of td's elements).

line 1868 change:

from

if ( aLayout[i][j].unique &&
(!aReturn[j] || !oSettings.bSortCellsTop) )

to

if ( aLayout[i][j].unique &&
aLayout[i][j].cell.nodeName.toLowerCase() == 'th' &&
(!aReturn[j] || !oSettings.bSortCellsTop) )

In my case I could not apply the sort and filter to a table with a header in multiple rows because DataTables applied the listener to the last line (the td's elements row) rather then the th's row.

Thanks in advice

Luke

Replies

  • allanallan Posts: 63,685Questions: 1Answers: 10,498 Site admin
    Can you link me to a test case that demonstrates this issue - just the THEAD code would probably do. That way I can add a unit test to make sure it doesn't happen again.

    Allan
This discussion has been closed.