Error in Google Chrome

Error in Google Chrome

tuurtnt@hotmail.comtuurtnt@hotmail.com Posts: 7Questions: 0Answers: 0
edited October 2010 in Bug reports
I get the following error in Google Chrome:

[code]
Uncaught TypeError: Cannot read property 'asSorting' of undefined
(anonymous function)/js/jquery.dataTables-1.7.3.min.js:139
[/code]

Replies

  • tuurtnt@hotmail.comtuurtnt@hotmail.com Posts: 7Questions: 0Answers: 0
    The same error is in the full version of the file:

    Uncaught TypeError: Cannot read property 'asSorting' of undefined LINE 6631
  • carlhoerbergcarlhoerberg Posts: 1Questions: 0Answers: 0
    Make sure that your THEAD cells uses TH and not TD
  • jkadakiajkadakia Posts: 2Questions: 0Answers: 0
    Thanks a ton Carl.
  • TobsnTobsn Posts: 1Questions: 0Answers: 0
    what if i load the column names from the server? i'm getting this error and i pass in a iColumns sColumns. :/
  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin
    If you load column names from the server, you need to do some kind of post processing on the Ajax response form the server since DataTables won't automatically put in any column information from the server. For example you could do $.ajax() to get the initialisation you want for the DataTable and then just use that for the initialisation.

    Allan
  • JosepsmithJosepsmith Posts: 1Questions: 0Answers: 0
    Hello,
    Chrome error is not something unique happened to you.
    Sometimes there is a dreadful total crash of the browser and sometime it sends ddifferent errors, upon restarting nothing happens.
    Such sorts of errors can be linked to the file association issues. The file association references are the important components of the registry database in Windows.
    A registry repair scan, which has the power to fix file association errors, will help you to find the solution for Google chrome error.

    I fixed this error after reading this article

    http://ezinearticles.com/?Chrome-Error---How-Do-I-Fix-Google-Chrome-Error?&id=3757035

    Hope you might get help from this article too.
  • macoolmacool Posts: 1Questions: 0Answers: 0
    Hey,
    I had this error too. I solved it by changing my table's HTML. I didn't have thead and tbody, so I did:

    [code]



    Column 1
    Column 2




    Row 1
    Row 1



    [/code]
  • OliverRCOliverRC Posts: 2Questions: 0Answers: 0
    I had this problem when I incorrectly defined my aaSorting like this:
    [code]"aaSorting": [0, 'asc'][/code]
    instead of:
    [code]"aaSorting": [[0, 'asc']][/code]
  • mervemerve Posts: 3Questions: 0Answers: 0
    what if i dont need thead? is it possible?
  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin
    No - DataTables requires a thead element - http://datatables.net/usage/#prerequisites

    Allan
  • aknudsenaknudsen Posts: 2Questions: 0Answers: 0
    I ran into this issue too, I definitely think DataTables should detect that the table doesn't define any 'th' elements and throw a corresponding exception. The current error is way too indirect and difficult to relate to the originating issue (i.e., that the table doesn't define column headers).
  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin
    It isn't as simple as that I'm afraid - DataTables can actually create a thead element for you if it does detect one, you need to supply sName for the columns and it will create the element. This is useful for dynamically created tables.

    Ultimately yes, there should be a 'debug' version of DataTables that provides trace information about everything so every little issue can be tracked and understood, but like jQuery the general view with DataTables is that there isn't much error handling since it is redundant code once you've got your table correctly setup.

    Not to say it isn't useful! I really do want to do a debug version, and have done for years. Other things just keep taking priority!

    Allan
  • aknudsenaknudsen Posts: 2Questions: 0Answers: 0
    Didn't realize it'd be that infeasible to throw an exception in case table headers are missing, but then again I'm not a JavaScript guru.
  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin
    No its not infeasible - you'd just do `if ( $('thead', table).length === 0 ) { throw 'No thead!'; }` - what I'm suggesting is that it isn't practical since DataTables can, under certain conditions, inject and build a thead element, with columns for you - so simply not having a thead is not a valid test (in this specific case).

    So certainly it is possible (as most things are with a little extra code :-) ), but adding error conditions is not something I want to put into DataTables core at this time - it would be suitable for a debug version, which is on the cards, but a good way out (with v1.10 taking priority at the moment).

    Allan
  • DmitryKrasnikovDmitryKrasnikov Posts: 2Questions: 0Answers: 0
    edited February 2013
    I'm having this issue with "Uncaught TypeError: Cannot read property 'className' of undefined " and it drives me crazy. Double checked table structure - yes, it has thead and tbody element
    The error happens with simple initializaition with no parameters

    error happens here:
    /* Classes */
    if ( bClass )
    {
    nCell.className += ' '+oCol.sClass;
    }

    my debug code is http://debug.datatables.net/iqilic
  • DmitryKrasnikovDmitryKrasnikov Posts: 2Questions: 0Answers: 0
    my fault. i had inconsistent td number between tr.
This discussion has been closed.