colvisRestore
Restore the visibility of column to their original state.
Please note - this property requires the Buttons extension for DataTables.
Description
This colvisRestore
button type provides a single click button that will restore the visibility state of the columns to match that when the button was created. This works by reading the state as the button is created (which is generally during the initialisation of the table) and then restoring those values when activated by the end user.
Options
This button can have the following options set in its configuration object to customise its actions and display, in addition to those options which are available for all buttons (e.g. buttons.buttons.text
):
Name | Type | Default |
---|---|---|
action | ||
Restores the columns visibility. | ||
className | buttons-colvisRestore | |
The button's class name. See | ||
text | CSV | |
The button's display text. The text can be configured using this option (see |
Example
DataTables initialisation: Show column visibility and restore buttons:
new DataTable('#myTable', {
layout: {
topStart: {
buttons: ['colvis', 'colvisRestore']
}
}
});