{hero}

keys.clipboard

Since: KeyTable 2.4.0

Enable / disable clipboard interaction with KeyTable.
Please note - this property requires the KeyTable extension for DataTables.

Description

KeyTables provides spreadsheet like navigation for a DataTable and it typically used for editing data. Interaction with the copy and paste system commands is a natural extension of this navigation ability, and as of v2.4 KeyTable supports the copy and paste commands.

The copy command will copy the text inside the focused cell if no other text on the page is selected, and of course only if there is a focused cell. Otherwise the browser's default behaviour will apply. The text copied, by default is the displayed rendered text. The keys.clipboardOrthogonal parameter can be used to control this.

The paste command will place the text that is currently in the clipboard into the cell. If Editor is active on the table (keys.editor) Editor will be activated for the cell, the value written to and then submitted. If Editor is not active on the table, the value will be written to the cell using cell().data(). Only if a cell has KeyTable focus and there is no active element on the page (i.e. an input which has focus) will the paste command be enacted.

Type

boolean

Description:

A boolean flag that can optionally be used to disable KeyTables' clipboard interaction.

Default

  • Value: true

The end user can copy and paste values from and to the KeyTable focused cell.

Example

Disable clipboard interaction:

new DataTable('#myTable', {
	keys: {
		clipboard: false
	}
});

Related

The following options are directly related and may also be useful in your application development.