{hero}

buttons-processing

Since: Buttons 1.5.7

A button's processing state has changed.
Please note - this property requires the Buttons extension for DataTables.

Description

This event is triggered whenever a button's processing state is changed (button().processing()), allowing you to show information on screen when a button is taking whatever action it needs to - e.g. a modal might be shown or a div could be floated over the page to block further user interaction until the processing is complete.

Please note that, as with all DataTables emitted events, this event is triggered with the dt namespace. As such, if you use jQuery directly to listen for this event, you must also use the dt namespace by simply appending .dt to your event name. This is done automatically if you use the DataTables on() method.

Type

function function( e, indicator, buttonApi, dataTable, node, config )

Parameters:

Example

Insert an element into the document when a button is processing:

var table = new DataTable('#myTable');
var overlay = $('<div class="ui-blocker">Please wait...</div>');

table.on('buttons-processing', function (e, indicator) {
	if (indicator) {
		overlay.appendTo('body');
	}
	else {
		overlay.remove();
	}
});

Related

The following options are directly related and may also be useful in your application development.