Return value undefined instead of null

Return value undefined instead of null

NooneNoone Posts: 1Questions: 0Answers: 0
edited March 2013 in Bug reports
fnDrawCallback I change a row where I remove 2 tds, and put a collspan of 3 on the remaining one.

This was done for grouping rows, and that the group row itself is selectable.

The result is that :
_fnGetTdNodes returns undefined because you push only 1 td and you don't look if there is a collspan (possible solution for me is in comment):
[code]
sNodeName = nTd.nodeName.toLowerCase();
if ( sNodeName == 'td' || sNodeName == 'th' )
{
// var colSpan = nTd.colSpan;
// if(colSpan > 1){
// for ( var int = 0; int < colSpan; int++) {
// anTds.push( nTd );
// }
// }else{
// anTds.push( nTd );
// }
anTds.push( nTd );
}

...
return anReturn;
[/code]

Atleast anReturn should not be returning "undefined" but atleast null because in function _fnCalculateColumnWidths, _fnGetWidestNode calls _fnGetTdNodes which returns undefined

[code]
var nTd = _fnGetWidestNode( oSettings, i );
if ( nTd !== null ){
nTd = nTd.cloneNode(true);
//nTd == undefined --> error cloneNode
[/code]

I hope you can fix this. A piety i couldn't overwrite the method myself.
This discussion has been closed.