{hero}

orderRemove

Since: ColumnControl 1.0.0

Remove the host column from multi-column ordering.
Please note - this property requires the ColumnControl extension for DataTables.

Description

This content type adds a button which interacts with DataTable's multi-column ordering abilities. While orderAddAsc and orderAddDesc will add a column to the ordering of the table, this button will remove the host column from the ordering, and then redraw the table.

As an example, if you have the table ordered by columns 1, 2 and 3 (any direction), then trigger this button for column 2, the resulting ordering for the table would be on columns 1 and 3.

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: orderRemove

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: Remove from sort

Trigger button text (shown when in a dropdown). Can also be set by the orderRemove key of language.columnControl, which will take priority if set.

Example

Multi-column ordering buttons in a dropdown.:

new DataTable('#example', {
    columnControl: [
		'order',
		[
			'orderAddAsc',
			'orderAddDesc',
			'orderRemove'
		]
	],
    ordering: {
        indicators: false,
        handler: false
    }
});