button().remove()
Remove and delete the selected button.
Please note - this property requires the Buttons extension for DataTables.
Description
This method provides the ability to dynamically remove a button from a table after initialisation. The inverse of this method is button().add()
which can be used to add a new button dynamically.
Important: This method will effect the indexes of other buttons in the instances. If you are using index based selectors for the buttons, please ensure that you take this into account for API interactions after calling this method.
Type
function button().remove()
- Description:
Remove the selected button from the display. The button is destroyed and can no longer be used once removed.
- Returns:
DataTables API instance.
Example
Remove button index 2-4:
var table = new DataTable('#myTable');
table.button('2-4').remove();