Disable Sorting On Specific Columns In Datatable

In this example I will show you how to disable sorting on specific columns in datatable. If you want to remove sorting arrow or disabled sorting on specific column or all column in datatable then you need to use columnDefs in jquery. Datatable provide many features like sorting, pagination, search, and ordering for specific column but many time some feature are not useful as per client's project requirments.

Using datatable columnDefs function you can disable sorting on all columns, datatable sorting on specific column, datatables disable sorting on multiple columns, datatables remove sorting arrows for one column.

lets's see datatable disable sorting on particular column example.


ColumnDefs provide to set parameter allows you to assign specific options to columns in data tables.

"columnDefs": [ {
      "targets": 0,
      "searchable": false
    } ]
     'processing': true,
     'serverSide': true,
     'serverMethod': 'POST',
     'ajax': {
     'columns': [
        { data: 'id' }, /* index - 0 */
        { data: 'name' }, /* index - 1 */
        { data: 'email' }, /* index - 2 */
        { data: 'phone_no' }, /* index - 3 */
        { data: 'country' } /* index - 4 */
     'columnDefs': [ {
        'targets': [3,4], /* column index */
        'orderable': false, /* true or false */


You might also like :


Techsolutionstuff | The Complete Guide

I'm a software engineer and the founder of techsolutionstuff.com. Hailing from India, I craft articles, tutorials, tricks, and tips to aid developers. Explore Laravel, PHP, MySQL, jQuery, Bootstrap, Node.js, Vue.js, and AngularJS in our tech stack.