FixedColumns example Select - checkboxes

The Select extension for DataTables has the ability to show a checkbox column to allow row selection and this is a natural fit for FixedColumns where you can have the checkbox column fixed and easily accessible.

The Select extension's documentation details the checkbox selection options in detail, but note that support is automatic for FixedColumns. No additional configuration is required in order to be able use both together.

The Javascript shown below is used to initialise the table shown in this example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$(document).ready(function() {
    $('#example').DataTable( {
        scrollY:        300,
        scrollX:        true,
        scrollCollapse: true,
        paging:         false,
        fixedColumns:   true,
        columnDefs: [ {
            orderable: false,
            className: 'select-checkbox',
            targets:   0
        } ],
        select: {
            style:    'os',
            selector: 'td:first-child'
        },
        order: [[ 1, 'asc' ]]
    } );
} );

In addition to the above code, the following Javascript library files are loaded for use in this example: