Problem running DataTable in IE7

Problem running DataTable in IE7

anjibmananjibman Posts: 115Questions: 10Answers: 0
edited October 2010 in General
When I run DataTable in the IE 7.0 I get the error saying

Line: 722
Error: 'length' is null or not an object
Debug? Yes/No

But Table get loaded even I don't debug.

I am confuse what's going on? Can any one help me to solve this problem.

Thanks
Anjib

Replies

  • SRussellNSRussellN Posts: 15Questions: 0Answers: 0
    I wonder if you are referencing the length menu (how many items to show per page) in the initialization (aLengthMenu), but not giving it a place in the sDom?

    What does your dataTable init look like?
  • anjibmananjibman Posts: 115Questions: 10Answers: 0
    No I am referring to following length inside DataTable.js file

    [code]
    _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 ) //<-- This length
    {
    return 'numeric';
    }
    [/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Can you give us a link please?

    Allan
  • anjibmananjibman Posts: 115Questions: 10Answers: 0
    Sorry its in Intranet.
    But my code looks likes as follow:

    1. DataTable Initialization
    [code]
    /* Initialse DataTables for Sentbox */
    var sTable = $('#myTable').dataTable({
    "aoColumns": [
    null,
    {"sClass": "center"},
    null,
    {"sClass": "center"},
    {"sClass": "center"}
    ],
    "aaSorting": [[3, 'desc']]

    });
    [/code]

    2. Table in JSP Page
    [code]



    Heading 1
    Heading 2
    ......................



    // Main record row

    Data 1
    Data 2
    ...................

    // Sub list row



    List Item 1
    List Item 2
    .......................








    [/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    If you put a space in here: , does that solve it? Also, are you running DataTables 1.7.3?

    Allan
  • anjibmananjibman Posts: 115Questions: 10Answers: 0
    Make change to JSP as follow to make it simple.

    [code]



    Heading 1
    Heading 2
    ......................



    // Main record row

    Data 1
    Data 2
    ...................



    [/code]

    And I am using DataTable 1.7.2. Should I upgrade to 1.7.3?

    Anjib
  • anjibmananjibman Posts: 115Questions: 10Answers: 0
    Update:
    1. Tested on Firefox 3.6.11 --> Working fine
    2. I think because of this error in IE no paging and searching feature is initialized in IE. So just a table displayed in IE.
    3. Tested with 1.7.3 --> Problem still persist.

    Anjib
  • anjibmananjibman Posts: 115Questions: 10Answers: 0
    More Updates:
    After doing some debugging on this issue I find out that
    1. This 'length' null message is display on first run only i.e. on first run only partial data is loaded on the table.
    2. If you refresh the table its start working fine from second run.
    3. In my case this is happening on random number of record but usually after 5/6 records it breaks.

    Anjib
  • anjibmananjibman Posts: 115Questions: 10Answers: 0
    Ok after long test and debug i found
    - datatable can't initialize my all records it break after 5/6 record and that why its getting 'length' as null.
    - its happening to both firefox and IE (sorry for early misinformation).

    Anjib
This discussion has been closed.