{hero}

buttons.name

Since: Buttons 3.0.0

Set a name for the instance for the group selector.
Please note - this property requires the Buttons extension for DataTables.

Description

As multiple Buttons instances can be attached to a single DataTable, it can be useful to be able to select each instance individually. This option provides the ability to set a name for the instance so it can later be selected using the button-group-selector option of the buttons() and button() API methods.

The instance name does not need to be unique. If a group selector is given that matches multiple instances, all matching instances will be selected.

Type

string

Description:

The name to set for the Buttons instance

Default

  • Value: main

Example

Setting the name in the DataTables buttons option:

new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: {
				name: 'primary',
				buttons: [
					// ...
				]
			}
		}
	}
});