aTargets not interpreted

aTargets not interpreted

curtcurt Posts: 2Questions: 0Answers: 0
edited June 2011 in Bug reports
In my datatable, I have my two last columns, that contain action icons. Those 2 columns (with class "d_th_nosort") don't need to be sortable.

I use the following code :

$(document).ready(function() {
var oTable = $('#distribtable').dataTable( {
"aaSorting": [[ 6, "desc" ],[ 1, "desc" ]],
"aoColumnDefs": [
{ "bSortable": false, "aTargets":["d_th_nosort"] }
]
} );
} );

without the aoColumnDefs definition, the DataTables work fine, but when I use this, I get an error "$.isArray is not a function" in jquery.dataTables.js at line 7176.
This line is :
if ( !$.isArray( aTargets ) )

Based on the documentation, I guess I must have done something wrong.
Can anybody please guide me on this issue?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Based on the documentation, and my own understanding of my own code - that looks absolutely fine to me!

    [quote]curt said: "$.isArray is not a function"[/quote]

    That suggests that $ is either not jQuery (which is should be in DataTables since it is wrapped up in a closure!) or that you are using jQuery <1.2 ( http://api.jquery.com/jQuery.inArray/ ).

    Can you give us a link to your page please - that would really help to understand what is going on.

    Thanks,
    Allan
  • curtcurt Posts: 2Questions: 0Answers: 0
    Thanks for your feedback allan.
    I saw that i was using jQuery 1.2.6
    Now that i have installed 1.5.2, it all falls back in place!

    Thanks again for the effort.
This discussion has been closed.