{hero}

buttons.resize()

Since: Buttons 1.0.0

Resize all Flash buttons once a table has been made visible.
Please note - this property requires the Buttons extension for DataTables.

Description

If the Flash export buttons (copyFlash, csvFlash, etc) are being used and the table is initialised when hidden, or the Buttons instance is constructed using the new $.fn.dataTable.Buttons() method, the Flash movie clips will have 0 pixels height and width. The result is that there is nothing for the end user to click on when the buttons are finally made visible for them to click on. This is particularly common in a tabbed interface.

This method can be invoked to have the Flash buttons adjust their size to fit the HTML button, thus presenting a clickable target to the end user.

The $.fn.dataTable.tables() method can be particularly useful with this method as it provides an easy way to access existing DataTables.

Type

function buttons.resize()

Description:

Resize the Flash movie clips to take account of the current button dimensions.

Returns:

Unmodified DataTable API instance for chaining

Examples

Resize the buttons:

$.fn.dataTable.tables( { api: true } )
	.buttons.resize();

Resize the buttons when made visible in a Bootstrap tab:

$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
	$.fn.dataTable.tables( { api: true } )
		.buttons.resize();
})