field().processing()

Since: Editor 1.8

Show / hide processing indicator for an individual field.
Please note - this property requires the Editor extension for DataTables.

Description

This method can be used to show an individual field in a processing state, or to get a field's current processing state. This can be useful when an asynchronous action is required on field input, letting the end user know that something is happening. For example a calculation is performed or an Ajax call is made to the server.

Types

field(…).processing()

Since: 1.9.5

Get the current processing state for this field.

Returns:

boolean: true if processing, false otherwise.

field(…).processing( set )

Show or hide the processing indicator for an individual field

Parameters:

Returns:

DataTable.Editor.Field: Field instance

Example

Show a processing indicator while making an Ajax call:

editor.field('input1').on('input', function () {
	editor.field('input1').processing(true);

	$.ajax({
		url: '/api/calculation',
		data: {
			input1: editor.field('input1').val()
		},
		success: function (json) {
			editor.field('calc').val(json.calculation);
			editor.field('input1').processing(false);
		}
	});
});

Related

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