IE error (Message: 'asSorting' is null or not an object)

IE error (Message: 'asSorting' is null or not an object)

ejeliotejeliot Posts: 5Questions: 0Answers: 0
edited August 2010 in Bug reports
I'm getting the following error in IE 8 (and most likely 6 & 7):

Message: 'asSorting' is null or not an object
Line: 6454
Char: 6
Code: 0

This may or may not be related to the issue and associated change described in:

http://datatables.net/forums/comments.php?DiscussionID=2451&page=1#Item_5

Replies

  • ejeliotejeliot Posts: 5Questions: 0Answers: 0
    Set up is basic - no configuration options specified (but as in the other bug group headers are being used with colspan).
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    Does this issue show up only with your change in? I've not encountered this problem before. If it is only when your change is in place, then I'm afraid it's a bug there ;-). If not, can you post a link to an example please.

    Allan
  • andresraiesteandresraieste Posts: 3Questions: 0Answers: 0
    I'm experiencing the same problem setting up server-side processing with ASP.NET MVC.
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    Can you provide us with a link so I can see what the issue might be please?

    Allan
  • leSaschleSasch Posts: 1Questions: 0Answers: 0
    @ejeliot:
    you have to use the - Tags around the markup used for the title-row of the table.

    Sascha
  • grobertsongrobertson Posts: 1Questions: 0Answers: 0
    This error also appears when you attempt to set aaSorting to a column number which doesn't exist. Always remember, column numbers start with 0, not 1.

    Example:

    [code]
    var oTable = $('#table').dataTable({
    "aaSorting": [[ 2, "desc" ]]
    ...
    [/code]

    With 3 columns, this is ok (column "2" is the zero-indexed column "3").

    With 2 columns, this will result in "asSorting' is null or not an object" because column "2" doesn't exist when referring to columns in zero-indexed values.

    Took a few minutes to figure out, hope this saves someone else a bit of time.
  • mgodoymgodoy Posts: 1Questions: 0Answers: 0
    CommentAuthorleSasch CommentTimeAug 31st 2010
    @ejeliot:
    you have to use the - Tags around the markup used for the title-row of the table.

    Sascha

    >>> You were right at least with my issue. i got the same error message i finally get the correct dynamic table structure as :



    x NColumns




    x NColumns
    x MRows



    and it works!. issue solved

    thanks a lot Sascha, you saved me, a lot of time :)
  • adrianvadrianv Posts: 1Questions: 0Answers: 0
    Hello, I know that this comment is too late, but I started recently to use the datatable plugin and ran into this problem. Sascha's answer gave me the hint, I am using the plugin with a rendered ASP.NET GridView, the problem is that by default it does not render the and tags, following the instructions in this link http://blueorbitsoftware.com/blog/?p=17 I was able to solve the problem
    Thxs
  • AnthonyPAnthonyP Posts: 2Questions: 0Answers: 0
    Had the same issue for:

    HTML:


    JS:
    $('#table0').dataTable({
    bJQueryUI: true,
    bSort: false
    });

    Solution was:

    $('#table0').dataTable({
    bJQueryUI: true,
    bSort: false,
    aoData: [{}]
    });

    The issue was caused by dataTable trying to apply initial sorting criteria on a 0 column when no columns have been found. So it tried to apply the initial default sorting criteria [[0,'asc',0]] on an 'unidentified' column.
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    Hi AnthonyP,

    Thanks very much for your post! DataTables doesn't actually allow columns to be added or removed after initialisation and if no column / row information is passed in (its perfectly possibly to write a plug-in API method that will do that, but not yet done - still on the list :-) ), so a table with no columns isn't actually going to be all that useful.

    What was your use case for doing it this way?

    Allan
  • AnthonyPAnthonyP Posts: 2Questions: 0Answers: 0
    edited November 2011
    Hi Allan,

    That's what I actually need. I'm trying to have some initial settings to display the table (with style applied and properly re-sized) and then to load the rest of settings, and after that to load the actual data. Settings can vary base on a button you click (data can vary either).

    So far the only way I found to achieve this is to re-create dataTable with new settings, or (as you say) to write a plug-in method that does something similar to what dataTable does to "oInit", but applies changes to the current instance of dataTable.

    AnthonyP
This discussion has been closed.