1jquery datatable disable sorting on specific columns
2
3"columnDefs": [
4 { "orderable": false, "targets": 2 }
5 ]
6
7JSFiddle Here
8
9<!--Script.js-->
10$('#table').DataTable( {
11"columnDefs": [
12 { "orderable": false, "targets": 2 }
13 ]
14 });
15<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
16<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
17<link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet"/>
18
19<table class="table table-striped table-bordered post-list-table" id="table" >
20 <thead>
21 <tr>
22 <th>Title</th>
23 <th>Created At</th>
24 <th>Action</th>
25 </tr>
26 </thead>
27</table>
1$('#id-of-my-table').DataTable({
2 "columnDefs": [
3 { "orderable": false, "targets": [0, 4, 5, 6] },
4 { "orderable": true, "targets": [1, 2, 3] }
5 ]
6});
7