1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
<?xml version="1.0" encoding="UTF-8" ?>
<dt-option group="columns">
<name>columns.orderable</name>
<summary>Enable or disable ordering on this column</summary>
<since>1.10</since>
<type type="boolean" />
<default value="true" />
<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 `dt-init order` option or the `dt-api order()` method if required.
</description>
<example title="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)"><![CDATA[
$('#example').DataTable( {
columnDefs: [
{ orderable: false, targets: 0 }
],
order: [[1, 'asc']]
} );
]]></example>
<example title="Disable ordering on the first column with `dt-init columnDefs`"><![CDATA[
$('#example').DataTable( {
columnDefs: [
{ orderable: false, targets: 0 }
]
} );
]]></example>
<example title="Disable ordering on the first column with `dt-init columns`"><![CDATA[
$('#example').DataTable( {
columns: [
{ orderable: false },
null,
null,
null,
null
]
} );
]]></example>
<related type="option">ordering</related>
<related type="option">order</related>
<related type="api">order()</related>
<related type="api">column().order()</related>
<related type="api">columns().order()</related>
</dt-option>
|