aoColumns causes a Error: Object does not support this property or method.

aoColumns causes a Error: Object does not support this property or method.

RoszakRoszak Posts: 5Questions: 0Answers: 0
edited July 2012 in DataTables 1.9
My table sorting works fine other than its doing a string sort and I need to use a numeric sort on my first column. When I add the "aoColumns line below all sorting goes away and I see an IE 7 alert: "Error: Object does not support this property or method"

Any thoughts on what I'm doing wrong?


$("theTable").ready(function() {
$("#theTable").dataTable( {
"sPaginationType" : "full_numbers",
"sDom": '<"top"i>rt<"bottom"flp><"clear">',
"bAutoWidth": false,
"iDisplayLength": 50,
"aoColumns": [
{ "sType": "numeric" }, null, null, null, null ] }
);
} );


Thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    The 'numeric' type is automatically found by DataTables. If it isn't being found, then you have non-numeric data in the column. Can you please either link us to your page or run the table through the DataTables debugger.

    Allan
  • RoszakRoszak Posts: 5Questions: 0Answers: 0
    I changed the sType line to null and it still gave me the same error. So it does not look like the type is the issue.

    $("theTable").ready(function() {
    $("#theTable").dataTable( {
    "sPaginationType" : "full_numbers",
    "sDom": '<"top"i>rt<"bottom"flp><"clear">',
    "bAutoWidth": false,
    "iDisplayLength": 50,
    "aoColumns": [
    { null, null, null, null, null ] }
    );
    } );

    Thanks
  • RoszakRoszak Posts: 5Questions: 0Answers: 0
    The above should have been:

    $("theTable").ready(function() {
    $("#theTable").dataTable( {
    "sPaginationType" : "full_numbers",
    "sDom": '<"top"i>rt<"bottom"flp><"clear">',
    "bAutoWidth": false,
    "iDisplayLength": 50,
    "aoColumns": [
    null,null, null, null, null ]
    } );
    } );
  • RoszakRoszak Posts: 5Questions: 0Answers: 0
    I resolved this issue. I was pointing to a version of jquery.js that was not part of the Datatables version 1.9. One I repointed to Datatables/media/js/jquery.js it resolved and sorting is working correctly.
This discussion has been closed.