buttons.buttons.name

Since: Buttons 1.0.0

Set a name for each selection. Please note - this property requires the Buttons extension for DataTables.

Description

The buttons() and button() API methods provide the ability to use a button-selector to be able to select one or more buttons in one or more Buttons instances. In turn the button selector provides an option to easily select a button by using a predefined name (thus removing any complexities that might occur if using index selection). This option provides the ability to set that name.

Multiple buttons can share the same name, they need not be unique, but please be aware that they will always be selected together if using a name selector.

Type

string

Description:

Default

  • Value: undefined

Examples

DataTables initialisation: Set a button's name:

$('#myTable').DataTable( {
	buttons: [
		{ extend: 'copy', name: 'copy' }
	}
} );

Instance initialisation: Set a button's name:

new $.fn.dataTable.Buttons( table, {
	buttons: [
		{
			extend: 'print',
			name: 'printButton'
		}
	}
} );