Since: Buttons 1.3.0

Get / set the processing state for a button.
Please note - this property requires the Buttons extension for DataTables.


Some actions that can be triggered by a button click can take a noticeable amount of time to complete - for example getting data from a server via an Ajax request, building a complex PDF document or any other asynchronous action. While the processing for that action is happening, it can be helpful to the end user to let them know that something is happening by showing a processing indicator. This method provides exactly that ability.

The typical use case will be to use this.processing( true ); at the start of an action function and that.processing( false ); inside a complete callback (where that = this).


function button().processing()


Determine if a button is currently in the processing state or not.


true if the button is currently in its processing state, false otherwise.

function button().processing( set )


Set the processing state for the selected button.


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


Show button index 1 as processing:

var table = $('#myTable').DataTable();
table.button( 1 ).processing( true );

Use the processing method inside an action function:

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

	.button( 0 )
	.action( function () {
		this.processing( true );

		// Do something...

		this.processing( false );
	} );


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