{hero}

buttons.buttons.enabled

Since: Buttons 3.0.0

Set a button's initial enabled state.
Please note - this property requires the Buttons extension for DataTables.

Description

This option provides the ability to set the initial enabled state of a button using a boolean value. It is most likely to be of use when using the API methods that can control the button's enabled state after initialisation:

Type

boolean

Description:

A boolean flag to indicate the initial enabled state of the button upon initialisation:

  • false - disabled
  • true - enabled

An undefined value is the same as true.

Default

  • Value: true

Example

Disable a button on initialisation:

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