{hero}

autoFill().disable()

Since: AutoFill 2.2.0

Disable AutoFill's interactions.
Please note - this property requires the AutoFill extension for DataTables.

Description

This method can be used to disable AutoFill's end user interaction options with a DataTable during run time. This can be useful if your UI does not allow for AutoFill to be used under certain circumstances.

Type

autoFill().disable()

Disable AutoFill. Please note that this disallows future interactions with the table (until re-enabled).

Returns:

DataTables.ApiDataTables API instance

Example

Toggle the enabled state of AutoFill on a button click:

var table = new DataTable('#myTable', {
	autoFill: true
});

document
	.querySelector('#toggleAutoFill')
	.addEventListener('click', function () {
		if (table.autoFill().enabled()) {
			table.autoFill().disable();
		}
		else {
			table.autoFill().enable();
		}
	});

Related

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