orderClear
Remove all ordering from the table.
Please note - this property requires the ColumnControl extension for DataTables.
Description
This content type will add a button that removes any ordering applied to the table (from any column, not just this host one), and then redraws the table. This will result in the table being drawn with the rows in the order that they were initially loaded.
Display
The button added by this control will display as a simple icon button at the top level, or as a button with icon and text in a dropdown. It is generally expected that it will be used in a dropdown to avoid cluttering the UI.
Options
This button can have the following options set in its configuration object to customise its actions and display, in addition to those options which are available for all buttons (e.g. buttons.buttons.text
):
icon
- Type:
string
- Default:
orderClear
Button icon. Can take the name of any icon available in DataTable.ColumnControl.icons
(which is a writeable object containing SVG icons).
text
- Type:
string
- Default:
Clear sort
Trigger button text (shown when in a dropdown). Can also be set by the orderClear
key of language.columnControl
, which will take priority if set.
Example
Show the orderClear
button in a dropdown.:
new DataTable('#example', {
columnControl: [
'order',
[
'orderClear'
]
],
ordering: {
indicators: false,
handler: false
}
});