_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
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
Can you try the 1.10.8-dev nightly from the downloads page please? I believe this issue was addressed a few weeks ago in the nightly code.
Allan
Hello Allan,
thank you very much! https://github.com/DataTables/DataTables/commit/17130d2fd54aac95bd39c88d830d71a73ad06487
This commit resolved the problem:)
Have a nice day!