How to Disable sorting of only one specific column in Data tables?

datatables remove sorting arrows for one column
jquery datatable disable sorting on first column
jquery datatable disable sorting dynamically
datatable disable sorting on specific column
datatables disable sorting all columns
disable sorting in datatable last column
datatables disable default sorting
datatables sort exclude column

Suppose i have the table like below :

And I want to disable sorting of Action Column

<!--index.html-->      
<table class="table table-striped table-bordered post-list-table" id="table" >
  <thead>                      
    <tr>
      <th>Title</th>
      <th>Created At</th>
      <th>Action</th>
    </tr>
  </thead>
</table>

<!--Script.js-->
$('#table').DataTable();

Try adding : columns.orderable

"columnDefs": [
    { "orderable": false, "targets": 2 }
  ]

JSFiddle Here

<!--Script.js-->
$('#table').DataTable( {
"columnDefs": [
    { "orderable": false, "targets": 2 }
  ]
  });
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet"/>

<table class="table table-striped table-bordered post-list-table" id="table" >
  <thead>                      
    <tr>
      <th>Title</th>
      <th>Created At</th>
      <th>Action</th>
    </tr>
  </thead>
</table>

Disable sorting of one column — DataTables forums, DataTables 1.10. Enable or disable ordering on this column. Note that this option only affects the end user's ability to order a column. Developers are still� It took me a while for me to figure out how to disable the sorting on a specific column when using data tables hence I thought I’d share some code on this could be accomplished. The below configuration settings that are passed to datatables, disable the up and down arrow options as shown in the screenshot below for the first column from when

Try this

$('#table').dataTable({
    // display everything
    "iDisplayLength": -1,
    "aoColumns":[
        {"bSortable": true},
        {"bSortable": true},
        {"bSortable": false}
    ]
});

for reference - https://stackoverflow.com/a/7878609/1982631

columns.orderable, Try adding : columns.orderable "columnDefs": [ { "orderable": false, "targets": 2 } ]. JSFiddle Here. <!--Script.js--> $('#table').DataTable(� If you want to remove sorting arrows or disable sorting on specific columns in datatables library than you can do it using columnDefs. we can simple disable ordering arrows from table in data tables js. even you are using with php, laravel, codeigniter, vue js etc. we can disable particular column sorting like one column, first column, last column, specific index.

Add a class to columns which you want to disable sort

<th class="no-sort">Operations</th>

then add the following style to your css

table.datatable thead th.no-sort {
    background: none;
    pointer-events: none;
}

How to Disable sorting of only one specific column in Data tables , Hi, My table has 8 columns, I want to disable sorting on columns 6,7,8. How can I do it I found some suggestion in old topics but it just not work for my case. This is possible with a “Custom Command” for the DataTables JS library. Please � Define your own date sorting method; Sort the table using an hidden column containing the date in Unix Timestamp (seconds elapsed since 1st January 1970). If you want your users to be able to sort the column by themselves you might use the first solution.----- First Solution: We need to tell the DataTable plugin what to do with our columns.

Do this in jQuery

var table = $('#tbl').DataTable({
            "columnDefs": [{ targets: 'no-sort', orderable: false }]});

and add a class 'no-sort' to whatever headers you want to disable sort like this..

<th class="no-sort">Header n</th>

Disable sorting on a certain columns, Sometimes we want to remove sorting in datatable so today we will learn how to disable sorting for any specific column in simple steps. I'm using jQuery DataTables in a project and I would like to know how to disable sorting for the last column. I want to implement this site-wide. Right now I have the following code: &lt;!-- jQuery

jQuery Datatable disable sorting for one column or multiple column, DataTable bydefault, add sorting option on all header columns.This can remove from a column if it is not necessary with columnDefs option while initialize. MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

Remove Sorting from Specific Column - DataTables, Disable sorting of a column when using Datatables want to generate a report containing certain data of only a selected list of employees. It's also important to learn about one of the most dangerous ways of sorting data in Excel, a method that can ruin your original data. The problem occurs when you have a large spreadsheet of data, but you accidentally sort only one column of data. Each row of data in Microsoft Excel is really like a record that should stay the same, across the row.

Disable sorting of a column when using Datatables, Suppose i have the table like below And I want to disable sorting of Action Columnltindexhtmlgt lttable classtable tablestriped t Sort using the Sort by Column button. There's another way to sort your data, by using the Sort by Column button in the Modeling ribbon. This approach to sorting requires that you first select the column (field) to sort from the Fields pane, and then select Modeling > Sort by Column to sort your visual. If you don't select a column, the Sort by

Comments
  • Possible duplicate of Jquery DataTables, sort by specific column?
  • Disable sorting on last column when using jQuery DataTables
  • OK !! Working Fine Now, Thanks For Your Effort
  • Apparently OP wanted to disable sorting on the last column, use targets: -1 so that you don't have to hardcode the column number. More info and full answer with an example here.
  • Works great with legacy version of DataTables.