Uncaught TypeError: Cannot read property 'asSorting' of undefined

Uncaught TypeError: Cannot read property 'asSorting' of undefined

stantor195stantor195 Posts: 4Questions: 0Answers: 0
edited April 2012 in General
Hi, I keep getting this error and I'm not sure how to fix it. Here is the code in my html file:
[code]

$(document).ready( function () {
$('#table_id').dataTable( {
"aaSorting"= []
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
iDisplayLength: 25,
iDisplayStart: 3,
"oLanguage": {
"sZeroRecords": "There are no records that match your search criterion",
"sLengthMenu": "Display _MENU_ records per page",
"sInfo": "Displaying _START_ to _END_ of _TOTAL_ records",
"sInfoEmpty": "Showing 0 to 0 of 0 records",
"sInfoFiltered": "(filtered from _MAX_ total records)"
},
sPagination: "full_numbers",
bStateSave: true,
sScorollX: "300px",
sScrollY: "200px",
oSearch: { "sSearch": "Type here...", "bRegex": false, "bSmart": false }
} );
});

[/code]

Replies

  • stantor195stantor195 Posts: 4Questions: 0Answers: 0
    It is saying that the error is in the jquery.dataTables.js on line: 6521

    [code]for ( j=0, jLen=oColumn.asSorting.length ; j
  • larryweyalarryweya Posts: 1Questions: 0Answers: 0
    In my case I was using DataTables with pivot js and the error was because I hadn't setup column headers properly. Through google I've found that it could also be if you are using instead of in your tbales in my case my was empty.
  • allanallan Posts: 61,435Questions: 1Answers: 10,049 Site admin
    @stantor195 - Can you link us to your page please?

    @larryweya - good to hear you found a solution tot he problem you had. With DataTables 1.9 you should be able to use TH and TD elements interchangeably with DataTables - either should work fine :-)

    Allan
  • stantor195stantor195 Posts: 4Questions: 0Answers: 0
    @Allan - http://ec2-50-16-148-205.compute-1.amazonaws.com:8080/
  • allanallan Posts: 61,435Questions: 1Answers: 10,049 Site admin
    Cannot connect to server I'm afraid... :-). Is it only up for part of the day?

    Allan
  • d3vkidd3vkid Posts: 1Questions: 0Answers: 0
    This error is generated when no section is provided. Make sure you have one in your table!
  • 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]
This discussion has been closed.