{hero}

reorderRight

Since: ColumnControl 1.0.0

Move a column one position to the right.
Please note - this property requires the ColumnControl extension for DataTables.

Description

This content type adds a button to the ColumnControl list, which, when triggered, will result in the host column being moved one position to the right. To illustrate, consider a table with three columns (1,2,3). If this button were activated on the middle column, it would be moved to be the last column in the table (i.e. the new order would be 1,3,2).

Please note that to operate this content type the ColReorder extension for DataTables is required.

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

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: Move column right

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

Example

Column reordering buttons in a dropdown.:

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