autoFill().enabled()
Determine if AutoFill is enabled or disabled.
Please note - this property requires the AutoFill extension for DataTables.
Description
This method can be used to determine if the AutoFill extension for a DataTable is enabled on a table or not. A simple boolean value is given indicating the status.
Type
function autoFill().enabled()
- Description:
This method will return a boolean value indicating if AutoFill is enabled or not on the selected table.
- Returns:
true
if AutoFill is enabled,false
otherwise.
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.