buttons-processing
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:
Name Type Optional 1 e
No jQuery event object
2 indicator
No true
if processing state is enabled.false
otherwise.3 buttonApi
No DataTables API instance for the selected button - i.e.
button()
for the button in question4 dt
No A DataTables API instance for the host DataTable
5 node
No jQuery instance for the button node that was clicked on
6 config
No The button's configuration object
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.