Datatable fails to load in IE7

Datatable fails to load in IE7

flippyheadflippyhead Posts: 11Questions: 0Answers: 0
edited August 2010 in Bug reports
Something in my data or setup no doubt, but IE7 is saying:

line 720
"length is null or not an object"

This is both from datatables 1.7.1 and 1.7.0, and happens on the length property of this:

_oExt.aTypes = [
/*
* Function: -
* Purpose: Check to see if a string is numeric
* Returns: string:'numeric' or null
* Inputs: string:sText - string to check
*/
function ( sData )
{
/* Allow zero length strings as a number */
if ( sData.length === 0 )
{
return 'numeric';
}


Any thoughts on how I can better diagnose? Safari, chrome, FF all work fine.

Replies

  • flippyheadflippyhead Posts: 11Questions: 0Answers: 0
    I also note that when I modify line 720 to check for null length the error (for the same initialization and table data) becomes:

    Line: 4480
    Character: 7
    Code: 0
    Error Message: 'className' is null or not an object
    URL: http://greencon-2011.localhost.com:3000/host/user_profiles

    Which is this:

    if ( nTds[i].className.indexOf(sClass+"1") != -1 )
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Can you put the page up on a publically addressable server and provide a link, so we can take a look? That or the initialisation code might help.

    Allan
  • flippyheadflippyhead Posts: 11Questions: 0Answers: 0
    Hi, thank you. I've got a page that demonstrates the issue here: http://mytwee.com/example.html

    As you can see it works in FF and Chrome, but not IE7
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Hi flippyhead,

    Thanks for the example - I believe that the problem is in your 'aoColumns' array definition. At the end of it you have a trailing comma. This should be removed, as it can cause odd things to happen with it in place. I've downloaded your example and removed that last comma and it seems to work quite happily in IE7 :-)

    Regards,
    Allan
  • bengalavizbengalaviz Posts: 6Questions: 0Answers: 0
    Argh! was having this issue and couldn't find the problem. Finally searched the forums and got it fixed. Thanks.
This discussion has been closed.