You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New: File export buttons now have a processing indicator. Useful for tables with a long export time
New: `-api button().processing()` and `-api buttons().processing()` methods which can be used to programmatically enable and disable the button's processing state
<summary>Get / set the processing state for a button</summary>
5
+
<since>1.3.0</since>
6
+
7
+
<typetype="function">
8
+
<signature>button().processing()</signature>
9
+
<returnstype="boolean">
10
+
`true` if the button is currently in its processing state, `false` otherwise.
11
+
</returns>
12
+
<description>
13
+
Determine if a button is currently in the processing state or not.
14
+
</description>
15
+
</type>
16
+
17
+
<typetype="function">
18
+
<signature>button().processing( set )</signature>
19
+
<parametertype="boolean"name="set">
20
+
Flag to indicate if the processing state should be enabled (`true`) or disabled (`false`).
21
+
</parameter>
22
+
<returnstype="DataTables.Api">
23
+
DataTables API instance with the selected button in the result set, available for chaining further operations on the buttons.
24
+
</returns>
25
+
<description>
26
+
Set the processing state for the selected button.
27
+
</description>
28
+
</type>
29
+
30
+
<description>
31
+
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.
32
+
33
+
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`).
34
+
</description>
35
+
36
+
<exampletitle="Show button index 1 as processing"><![CDATA[
37
+
38
+
var table = $('#myTable').DataTable();
39
+
table.button( 1 ).processing( true );
40
+
41
+
]]></example>
42
+
43
+
<exampletitle="Use the processing method inside an action function"><![CDATA[
<summary>Set the processing state for multiple buttons</summary>
5
+
<since>1.3.0</since>
6
+
7
+
<typetype="function">
8
+
<signature>buttons().processing( set )</signature>
9
+
<parametertype="boolean"name="set">
10
+
Flag to indicate if the processing state should be enabled (`true`) or disabled (`false`).
11
+
</parameter>
12
+
<returnstype="DataTables.Api">
13
+
DataTables API instance with the selected buttons in the result set, available for chaining further operations on the buttons.
14
+
</returns>
15
+
<description>
16
+
Set the processing state for the selected buttons.
17
+
</description>
18
+
</type>
19
+
20
+
<description>
21
+
This is an extension of the `-api buttons().processing()` method, which can be used to set the processing state for multiple buttons with a single API call. Care should be taken with this method since it could easily lead to end user confusion if multiple buttons are shown in the processing state at the same time.
22
+
</description>
23
+
24
+
<exampletitle="Set all buttons to show as processing"><![CDATA[
0 commit comments