columns.orderable
Enable or disable ordering on this column.
Description
Using this parameter, you can remove the end user's ability to order upon a column. This might be useful for generated content columns, for example if you have 'Edit' or 'Delete' buttons in the table.
Note that this option only affects the end user's ability to order a column. Developers are still able to order a column using the order
option or the order()
method if required.
Type
This option can be given in the following type(s):
Default
- Value:
true
Examples
Disable ordering on the first column AND set the default ordering for the table (the default would still be to order on column index 0 otherwise):
$('#example').DataTable( {
columnDefs: [
{ orderable: false, targets: 0 }
],
order: [[1, 'asc']]
} );
Disable ordering on the first column with columnDefs
:
$('#example').DataTable( {
columnDefs: [
{ orderable: false, targets: 0 }
]
} );
Disable ordering on the first column with columns
:
$('#example').DataTable( {
columns: [
{ orderable: false },
null,
null,
null,
null
]
} );
Related
The following options are directly related and may also be useful in your application development.