_fnDetectHeader() returns an array with less 'th' elements than there are in the header

_fnDetectHeader() returns an array with less 'th' elements than there are in the header

ToffeetaToffeeta Posts: 12Questions: 3Answers: 0
edited May 2015 in Free community support

Hello dear Support Team, dear Allan,

I've found some problem in the case if I would like to display a hidden column. Each time I've tryed to display it I've received an error that the headerCells[i] is undefined in this row:

headerCells[i].style.width = column.sWidthOrig !== null && column.sWidthOrig !== '' ?

I've found out, that in the function _fnDetectHeader()
the Jquery code in the line 2294 (DataTables 1.10.7)

$(nThead).children('tr')

returns one child less than if I use

document.getElementsByTagName('thead')[0].getElementsByTagName('tr')[0].getElementsByTagName('th')

or

$('th', oSettings.nTHead))

The results of the last two code segments are equal to the visibleColumns.length in the row 4162...

Only after _fnScrollDraw( settings ); (row 774) changes the number of children of $(nThead), so it's to late

Replies

This discussion has been closed.