{hero}

copyFlash

Since: Buttons 1.0.0

Click to copy table data to clipboard button (Adobe Flash - deprecated).
Please note - this property requires the Buttons extension for DataTables.

Deprecated

As of v1.2.0 this feature has been deprecated. This feature has not yet been scheduled for removal, but its use is discouraged and the alternatives discussed below should be used.

As Flash is now being expunged from all browsers, the Flash buttons are only suitable for use in old browsers. As such, they will no longer see new features developed for them after Buttons 1.2.0. They will be removed from the distribution in the next major release.

Description

This button provides a simple copy-to-clipboard action to the end user - they click the button and the table's content is automatically written into their clipboard.

Once the data from the table has been written to the clipboard, a message is shown to the end user stating this fact. The message shown can be customised through the buttons.copyTitle (title) and buttons.copyInfo (more detailed information) options of the DataTables language configuration object (see example below). By default they are is:

copyTitle: 'Copy to clipboard',
copyInfo: {
    _: 'Copied %d rows to clipboard',
    1: 'Copied 1 row to clipboard'
}

Adobe Flash is required for this button to operate. If Flash is not installed, or disabled, in the end user's browser this button will not appear. For a non-Flash alternative please see the copyHtml5 button type. Additionally the copy will automatically select between this button and copyHtml5 depending on the features of the browser.

The action for this button cannot be activated using the button().trigger() or key combination methods due to the security restrictions of Flash.

Options

This button can have the following options set in its configuration object to customise its actions and display:

Examples

DataTables initialisation: Use the Flash copy button:

$('#myTable').DataTable( {
	buttons: [
		'copyFlash'
	]
} );

DataTables initialisation: Use the copy button type to automatically select between the Flash and HTML button options.:

$('#myTable').DataTable( {
	buttons: [
		'copy'
	]
} );

DataTables initialisation: Use the exportOptions to copy only the current DataTable page:

$('#myTable').DataTable( {
	buttons: [
		{
			extend: 'copyFlash',
			text: 'Copy current page',
			exportOptions: {
				modifier: {
					page: 'current'
				}
			}
		}
	]
} );

DataTables initialisation: Use the language object to set the information displayed when activated:

$('#myTable').DataTable( {
	language: 
		buttons: {
			copyTitle: 'Data copied',
			copyInfo: {
				_: 'Copied %d items',
				1: 'Copied a single item'
			}
		}
	},
	buttons: [
		'copyFlash'
	]
} );