Posted inJavaScript / jQuery

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

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.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype