NULL data error with patch

NULL data error with patch

mainstreetmarkmainstreetmark Posts: 9Questions: 0Answers: 0
edited October 2009 in General
For some reason, I keep getting "null" data in sData, even though it looks like data is coming back. This causes a JS error and halts all further JS activity on the page. My fix is, around line 680 (in version 1.5.3):

[code]
/* Snaity check that we are dealing with a string or quick return for a number */
if (sData == null )
{
return null;
}
else if ( typeof sData == 'number' )
{
return 'numeric';
}
else if ( typeof sData.charAt != 'function' )
{
return null;
}
[/code]

Replies

  • allanallan Posts: 61,758Questions: 1Answers: 10,111 Site admin
    Hi mainstreetmark,

    This error tends to crop up when the number of columns that DataTables knows about does not match the number that have been given to it. For example this will happen with rowspan and colspan elements. Or if your data arrays are not exactly the right number of elements, or you haven't defined the number of columns quite right :-)

    There are quite a few reasons why it could be, but basically it comes down to data and columns not matching.

    Regards,
    Allan
This discussion has been closed.