datatable sorting false Example

datatable sorting false : Enable or disable ordering of columns. jquery datatables disable sorting row, disable sorting one column Also This post shows you how to disable sorting in jquery datatable.

datatable sorting false

here we can learn to jquery datatable disable sorting on specific columns. as well as Source code for disable sorting for multiple column.

Disable Sorting On Specific Columns In Datatable

Datatable disable sorting on particular column example

You can see sample code of columnDefs:

'columnDefs': [ {

    'targets': [1,3], /* your html tabel column index */
    'orderable': false, /* true or false */

 }]

Don’t Miss : Disable sorting in datatable for one column

Read Also:  Simple jQuery Auto Image Rotator

Use the following code to disable ordering on first column:

index.html

$(document).ready(function()
{
   $('#document_members').DataTable({
     'processing': true,
     'serverSide': true,
     'serverMethod': 'POST',
     'ajax': {
       'url':'/members/document_members.php'
     },
     'columns': [
        { data: 'id' }, /* index - zero */
        { data: 'member_name' }, /* index - first */
        { data: 'email' }, /* index - second */
        { data: 'mobile' }, /* index - thired */
        { data: 'country' } /* index - fourth */
     ],
     'columnDefs': [ {
        'targets': [3,4], /* column index */
        'orderable': false, /* true or false */
     }]
   });
});

Don’t Miss : Disable row in DataTable jquery

I hope you get an idea about datatable sorting false .
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.