{hero}

buttons.buttons

Since: Buttons 1.0.0

List of buttons to be created.
Please note - this property requires the Buttons extension for DataTables.

Examples

buttons as an array using basic types:

new DataTable('#myTable', {
	layout: {
		topStart: 'buttons'
	},
	buttons: ['copy', 'csv', 'print']
});

Two buttons, one with customisations:

new DataTable('#myTable', {
	buttons: ['copy', { extend: 'excel', text: 'Save as Excel' }]
});

A fully custom button:

new DataTable('#myTable', {
	layout: {
		topStart: 'buttons'
	},
	buttons: [
		'copy',
		{
			text: 'My button',
			action: function (dt) {
				console.log('My custom button!');
			}
		}
	]
});