{hero}

buttons().destroy()

Since: Buttons 1.0.0

Destroy one or more button instances and remove from the document.
Please note - this property requires the Buttons extension for DataTables.

Description

This method provides the ability to "destroy" one or more instances of the Buttons class. The destroy action will remove all DOM elements that is controls from the document and release any event handlers it holds.

When using the buttons() selector method, the second argument (the buttons selector) is effectively ignored when processing this method. Only the button instances are used.

This method is invoked automatically if the DataTable destroy() method is called on the host DataTable.

Type

function buttons().destroy()

Description:

Destroy the selected button instances, removing the container and all button elements from the document.

Returns:

DataTables API instance.

Examples

Destroy all button instances:

var table = new DataTable('#myTable');

table.buttons().destroy();

Destroy button instance 0 only:

var table = new DataTable('#myTable');

table.buttons(0, null).destroy();