Buttons
When working with a complex DataTable it is not uncommon to wish to present options that the end user can activate to affect the table, or the data contained within the table in some manner. Displaying buttons that can be clicked, tapped or triggered from a keyboard with one method of doing this and the Buttons extension provides exactly that ability.
The various DataTables extensions provide buttons that can be used to access the functionality of that extension; Editor for example provides add, edit and delete buttons for a table. The buttons that are available are documented here. Furthermore, custom buttons can also be created to perform actions that are specific to your use case.
Buttons can be used through the buttons
configuration object with dom
used to specify where the buttons should be placed:
$('#myTable').DataTable( {
dom: 'Bfrtip',
buttons: [
'colvis',
'excel',
'print'
]
} );
For further information about Buttons custom events, please refer to the Buttons extension documentation. Please note that DataTables core does not itself provide any buttons and the Buttons extension must be loaded in order to be able to use the buttons from the extensions.
Library | Name | Summary |
---|---|---|
Buttons | A button which triggers a drop down with another set of buttons | |
Buttons | A single button that will toggle the visibility of one or more columns | |
Buttons | A single button that controls the visibility of one or more columns | |
Buttons | A set of Buttons to toggle the visibility of individual columns | |
Buttons | A set of Buttons to set the visibility of individual columns | |
Buttons | A button collection that provides column visibility control | |
Buttons | Show and hide multiple columns | |
Buttons | Restore the visibility of column to their original state | |
Buttons | Copy table data to clipboard button | |
Buttons | Copy table data to clipboard button (HTML) | |
Buttons | Create and save a CSV file that contains the data from the table | |
Buttons | Create and save a CSV file that contains the data from the table (HTML5) | |
Buttons | Create and save an Excel CSV file that contains the data from the table | |
Buttons | Create and save an Excel XLSX file that contains the data from the table (HTML5) | |
Buttons | Button collection that will control the DataTables' page length | |
Buttons | Create and save a PDF file that contains the data from the table | |
Buttons | Create and save a PDF file that contains the data from the table (HTML5) | |
Buttons | Button show a printable view of the table's data | |
Buttons | A special "button" which provides visual grouping between buttons. | |
Editor | A button that will create a new row using Editor | |
Editor | A button that will insert a new row for inline row creation | |
Editor | A button that will edit one or more existing rows using Editor | |
Editor | A button that will edit an existing row using Editor | |
Editor | A button that will delete one or more rows using Editor | |
Editor | A button that will delete a single row using Editor | |
FixedColumns | A single button that initialises and allows FixedColumns to be toggled. | |
SearchBuilder | A single button that displays the SearchBuilder container in a popover. | |
SearchPanes | A single button that displays the SearchPanes container in a popover. | |
SearchPanes | A single button that clears the SearchPanes selections. | |
Select | Select all items in the table based on the current item select mode | |
Select | Change the item selection mode to | |
Select | Change the item selection mode to | |
Select | Deselect all selected items in the table. | |
Select | Change the item selection mode to | |
Select | Button that is enabled when one or more items are selected in the table | |
Select | Button that is enabled when a single item is selected in the table | |
Select | Toggle a filter that will reduce the rows displayed to just those which are selected. | |
StateRestore | Creates a new state, based off of the current state of the table. | |
StateRestore | Removes all stored states. | |
StateRestore | Removes a state from storage. | |
StateRestore | Renames a state. | |
StateRestore | Collection used to provide interaction with the saved states | |
StateRestore | Extends | |
StateRestore | A split button that represents and provides functionality for a saved state. | |
StateRestore | Updates a selected state with the current table state. |