buttons.buttons.enabled
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
- disabledtrue
- enabled
An undefined value is the same as
true
.
Default
- Value:
true
Examples
DataTables initialisation: Disable a button on initialisation:
$('#myTable').DataTable( {
buttons: {
buttons: [
'copy',
{ extend: 'excel', enabled: false }
]
}
} );
Instance initialisation: Disable a button on initialisation:
new $.fn.dataTable.Buttons( table, {
buttons: [
'copy',
{ extend: 'excel', enabled: false }
]
} );