jquerycsssortingdatatableremoveclass

DataTable jquery - How to remove sort icon from first column?


I want to disable the sort property in dataTable API. I use bsort:false to disable sorting from all the columns.

This works good but still first column show sort icon. Why ?

$("#reportgrid").DataTable({
    "order": [],"bSort" : false,
    "iDisplayLength": 10,
    "sDom": '<"top">rt<"bottom"lp><"clear">',
});

I use this code for dataTable.

enter image description here

Here is the snapshot of my grid. In which first column having css of sorting_asc but i already disable sorting.

So, How can i remove sort icon from first column ?


Solution

  • I found the answer. bStorable false for each of your column then only icon removed.

    $("#reportgrid").dataTable({"order": [],
        "aoColumns": [
        { "bSortable": false },
        { "bSortable": false },
        { "bSortable": false },
        { "bSortable": false },
        { "bSortable": false },
        { "bSortable": false }
    ],
    "sDom": '<"top">rt<"bottom"lp><"clear">'});