{hero}

button().trigger()

Since: Buttons 1.0.0

Trigger the action of the selected button.
Please note - this property requires the Buttons extension for DataTables.

Description

This method can be used to programmatically trigger the actions of the selected button. Typically a button's action will be triggered by an end user interaction (clicking, keyboard navigation), but it can be useful to trigger the action from code - for example to periodically update the data contained in a DataTable.

Please note that some buttons types might not be able to be triggered programmatically. Specifically Adobe Flash based buttons that are used for clipboard and local file saving actions cannot be triggered without a user click action as a security mechanism that is built into Flash and cannot be overridden.

Type

function button().trigger()

Description:

Programmatically trigger the action of the selected button.

Returns:

DataTables API instance with the selected buttons in the result set, available for chaining further operations on the buttons.

Example

Trigger the button at index 2-1:

var table = $('#myTable').DataTable();

table.button( '2-1' ).trigger();