Options
In general ColReorder doesn't require much initialisation, and as such doesn't provide any options. Having said that there are a couple of options as shown below.
Initialisation
Initialisation of ColReorder is done through the use of the DataTables sDom initialisation option and the parameter 'R' that ColReorder adds to DataTables. For example:
$(document).ready( function () {
$('#example').dataTable( {
"sDom": 'Rlfrtip'
} );
} );
ColReorder options
aiOrder
Show details
|
This parameter provides the ability to reorder a table on initialisation of the DataTable. It's simply an array of column indexes, in the order that you wish them to be displayed in. |
| Default: |
null |
| Type: |
Array |
| Code example: |
$(document).ready( function () {
var oTable = $('#example').dataTable( {
"sDom": 'Rlfrtip',
"oColReorder": {
"aiOrder": [ 4, 3, 2, 1, 0 ]
}
} );
} );
|
iFixedColumns
Show details
|
Indicate how many columns should be fixed in position (counting from the left). This will typically be 1 if used, but can be as high as you like. |
| Default: |
0 |
| Type: |
Integer |
| Code example: |
$(document).ready( function () {
var oTable = $('#example').dataTable( {
"sDom": 'Rlfrtip',
"oColReorder": {
"iFixedColumns": 1
}
} );
} );
|