JINESH
JINESH

Reputation: 1452

Disable sorting on all columnn when using jQuery DataTables

i am using datatables of jquery to sort the table fields.my question is how to disable sorting of all column? My code is,

$(document).ready(function () {
        $('#myTable').dataTable();
    });

    $('#myTable').DataTable({

        bFilter: false,aDataSort :false,
        paging: true,
        displayLength : 25

    });
    $('#myTable').dataTable({
        "aoColumns": [
        null,
        null,
        { "bSortable": false },
        null
        ]
    });

Upvotes: 0

Views: 456

Answers (1)

Mairaj Ahmad
Mairaj Ahmad

Reputation: 14604

Try this

$('#myTable').dataTable( {
"bSort": false
});

Or this

$('#myTable').dataTable({
    "aoColumns": [
    { "bSortable": false },
    { "bSortable": false },
    { "bSortable": false },
    { "bSortable": false }
    ]
});

Upvotes: 2

Related Questions