{hero}

buttons.buttons.name

Since: Buttons 3.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:

Name for the button so it can be addressed via the API.

Default

  • Value: undefined

Example

Set a button's name:

new DataTable('#myTable', {
	layout: {
		topEnd: {
			buttons: [{ extend: 'copy', name: 'copy' }]
		}
	}
});