{hero}

buttons.buttons.key

Since: Buttons 1.0.0

Define an activation key for a button.
Please note - this property requires the Buttons extension for DataTables.

Examples

Set a single key for a button:

new DataTable('#myTable', {
	layout: {
		topStart: 'buttons'
	},
	buttons: [{ extend: 'print', key: 'p' }]
});

Require alt key:

new DataTable('#myTable', {
	layout: {
		topStart: 'buttons'
	},
	buttons: [
		{
			extend: 'print',
			key: {
				key: 'p',
				altKey: true
			}
		}
	]
});