IE8: undefined is null or not an object - inside "single loop to rule them all"

IE8: undefined is null or not an object - inside "single loop to rule them all"

frequentfrequent Posts: 23Questions: 0Answers: 0
edited March 2012 in General
I'm sitting over this for a while now. I'm trying to get datatables to run inside a Jquery Mobile page (JQM 1.0.1., Jquery 1.7.1).

The datatables I plugged into the page works across latest browsers and on mobile devices. But IE8 is killing me...

I'm using two datatables inside my page. The 2nd one will only be initiated when the user navigates to the respective page section.

This is when I'm getting the above error "undefined is null or not an object" inside the "single loop to rule them all" on this line:

if ( bClass )
{
nCell.className += ' '+oCol.sClass;
}

It seems nCell is not defined.

Any clue what might be causing this?

Thanks for pointers.

Replies

  • flavinflavin Posts: 1Questions: 0Answers: 0
    edited March 2012
    The same here using jquery 1.7.1 and jquery.datatable 1.9.0
  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin
    Can you link me to an example that is showing the problem please? Do my own examples show it (they seem to be working okay for me)?

    Allan
  • emidlnemidln Posts: 2Questions: 0Answers: 0
    I'm seeing the same thing using jquery 1.7.1 and datatables 1.9.0. I'm also getting the error in Chromium 17.0.963.79 (Developer Build 125985 Linux) Ubuntu 11.10.
  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin
    As before, can you please link to an example showing the problem since I need to be able to reproduce the error to have any chance of finding out what is happening?

    Allan
  • virtualshockvirtualshock Posts: 1Questions: 0Answers: 0
    I was having the same issue and was able to resolve it. If you are defining aoColumns make sure that you don't have an extra comma after your final column definition.

    [code]
    "aoColumns": [
    {
    "bVisible":false,
    "bSearchable" : false
    }, <--- Extra comma will cause extra row(undefined on nCell) in Chrome and IE 8
    ],
    [/code]

    Your issues may not be related to this but I thought this could help some people with the 'undefined is null or not an object' error on nCell
  • gelbertgelbert Posts: 3Questions: 0Answers: 0
    I have this same problem. Link to DataTables debugger's trace: http://debug.datatables.net/uwuhis
    Odd thing that error happens not all the time and so far only for one dataset, while others are ok
  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin
    @gelbert: Is your debugger trace from when the error occurred? There _must_ be exactly rows * columns number of cells in the table. Since you are DOM loading the data, rather than Ajax loading, this seems like the most likely case.

    Allan
  • gelbertgelbert Posts: 3Questions: 0Answers: 0
    edited March 2012
    Hi Alan, Thanks for quick responce. You are right. I have made a typo in source for one of the table and depending on data set I was getting different number of cells then headers
This discussion has been closed.