DataTables – Excluding columns from sorting [no sort]

http://wiki.koha-community.org/wiki/DataTables_HowTo

Excluding columns from sorting

Often a table will have columns which should be excluded from sorting because they contain inputs or other controls. To exclude a column from sorting add a "nosort" class to the table header cell:

<thead>
  <tr>
   <th class="nosort">Don't sort this column</th>
   <th>Sort this column</th>
   <th>Sort this column</th>
   …

In the configuration for that table indicate that columns with class "nosort" should be excluded from sorting:

$(document).ready(function(){
    $("#mytable").dataTable($.extend(true, {}, dataTablesDefaults, {
        "aoColumnDefs": [
            { 'bSortable': false, 'aTargets': [ 'nosort' ] }
        ]
    }));
});

About selvam4win

I am Selvam. I am very jolly person and frank one.

Posted on December 16, 2014, in Uncategorized. Bookmark the permalink. Leave a comment.

Comments are closed.

%d bloggers like this: