Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datatables - how to prevent sorted column from changing color

Just started with Datatables. By default, when the user clicks a column row to sort, the whole column is shaded. Can somebody tell how to turn this feature off? I've been messing with the built-in CSS classes, and I had high hopes for the asSorting parameter, but I don't seem to be able to do it. If this is somewhere obvious on the Datatables web page and I'm not seeing it, sorry, but I can't find it.

Thanks for any help.

like image 538
Stanton Avatar asked Nov 18 '12 15:11

Stanton


2 Answers

v1.10+

As Mathieu indicates, order classes can now be disabled by setting orderClasses to false.

$('#example').dataTable({
    "orderClasses": false
});

v1.9-

As shown in: DataTables:Features, this functionality can be disabled by setting bSortClasses to false.

$('#example').dataTable({
    "bSortClasses": false
});
like image 131
seus Avatar answered Oct 23 '22 19:10

seus


You can just remove styles for td.sorting_1.

like image 25
Skpd Avatar answered Oct 23 '22 19:10

Skpd