ColReorder example FixedColumns integration

While ColReorder works with the built-in scrolling options in DataTables (scrollYDT and scrollXDT) and also the FixedColumns extension.

ColReorder provides the fixedColumnsLeft and fixedColumnsRight options which allows you disallow reordering of the fixed columns (which is required).

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
20
21
$(document).ready(function() {
    window.table = $('#example').DataTable( {
        dom: 'Rlfrtip',
        scrollX: true,
        scrollCollapse: true,
        columnDefs: [
            { sortable: false, targets: 0 },
            { sortable: false, targets: -1 }
        ],
        sorting: [[ 1, 'asc' ]],
        colReorder: {
            fixedColumnsLeft: 1,
            fixedColumnsRight: 1
        }
    } );
 
    window.fc = new $.fn.dataTable.FixedColumns( table, {
        leftColumns: 1,
        rightColumns: 1
    } );
} );

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