IE error 'parentNode' is null or not an object Line: 2732

IE error 'parentNode' is null or not an object Line: 2732

sfopeanosfopeano Posts: 6Questions: 0Answers: 0
edited October 2010 in Bug reports
My data table works fine in FF, but returns this error in IE. Looks like it has something to do with a hidden column.

I am using the latest version 1.7.3

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
Timestamp: Wed, 6 Oct 2010 23:32:31 UTC


Message: 'parentNode' is null or not an object
Line: 2732
Char: 8
Code: 0
URI: http://dev.aircarealliance.org/dev/js/jquery.dataTables.js

Here is the setup:
[code]
directoryTable = jQuery('#directory').dataTable({
"iDisplayLength":25,
"aaSorting": [[2,'asc']],
"aoColumns": [
{ "bSortable": true, "bVisible": true }, // ACA
{ "bSortable": false, "bVisible": false }, // Name for sorting
{ "bSortable": true, "bVisible": true, "iDataSort": 1 }, // Name
{ "bSortable": false, "bVisible": false}, // Service for sorting
{ "bSortable": true, "bVisible": true, "iDataSort": 3 }, // Service
{ "bSortable": false, "bVisible": true }, // Contact
{ "bSortable": false, "bVisible": false}, // Geography for filtering
]
});
[/code]

Replies

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    You've linked to the DataTables script, rather than your use of it :-), so it's a little difficult to be sure, but does your header include 7 TH elements - i.e. including the hidden ones? DataTables will hide then form you, but they must be in the header.

    Allan
  • sfopeanosfopeano Posts: 6Questions: 0Answers: 0
    Thanks Allan. Yes, there are seven TH elements, and it does work in both FF and Safari. I create the table in php and load it from a variable. I'm not sure what other clues I can give you. Thanks for your help...
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Can you link us to an example please (the link above is to DataTables - which we know where to get :-) ).

    Allan
  • sfopeanosfopeano Posts: 6Questions: 0Answers: 0
    Sure: http://dev.aircarealliance.org/resource-directory.

    Also, here is a clue from the console log: LOG: DataTables warning (table id = 'directory'): Unexpected number of TD elements. Expected 632 and got 474. DataTables 632 divided by the number of rows (79) is 8. Should be 7, no, since there are 7 columns? Also, 474 is 79 * 6, indicating that it's only getting six. Not sure how this is could be happening differently in IE vs. FF.
  • sfopeanosfopeano Posts: 6Questions: 0Answers: 0
    Looking at the output, some cells are missing from columns that should be hidden, but some cells are missing from columns that shouldn't be hidden as well. That probably accounts for the mis-counting.
  • sfopeanosfopeano Posts: 6Questions: 0Answers: 0
    Here are a couple of rows from the table raw output:

    [code]



    ACA
    Organization name for sorting
    Organization
    Service for filtering
    Service
    Contact
    Geography for filtering




    Non Member 
    Hope Flight Foundation 
    Hope Flight Foundation
    Keeping Hope and Joy Alive through free air transport for those in need
    P.O. Box 20505
    Castro Valley, CA 94546 
    ambulatory 
    Ambulatory patients
     
    www.hopeflightfoundation.org
    (510) 427-3956
    harding-hope@sbcglobal.net 
    CA,NV,OR,  



    Angel Flight Soars, Inc. 
    Angel Flight Soars, Inc.
    Removing the obstacle of transportation for those in medical and financial crisis
    2000 Airport Road
    Atlanta, GA 30341 
    ambulatory 
    Ambulatory patients
     
    www.angelflightsoars.org
    (770) 452-7958
    admin@angelflightsoars.org 
    AL,AR,GA,MS,NC,SC,TN,  

    [/code]
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Ah - you've got a trailing comma on your aoColumns array: http://datatables.net/faqs#comma . IE (I would say correctly) treats the following array element as null - Firefox and friends delete it. Just remove the comma and it will go away.

    Allan
  • sfopeanosfopeano Posts: 6Questions: 0Answers: 0
    Good grief... I apologize, I've run into that before and I should have spotted it. Thanks for your help, and big thanks for the fantastic system.

    Best,

    Stephan
This discussion has been closed.