Usage
Initialisation and configuration of AutoFill is performed through the autoFill initialisation option for DataTables. This option can be given as a simple boolean value to enable AutoFill with its default values, or as an object to provide more granular control.
Simple initialisation
In its most simple case, you can enable AutoFill by simply setting autoFill: true as an option in the DataTables initialisation:
new DataTable('#myTable', {
autoFill: true
});
If you do this, you may wish to use the autoFill event to know when the end user has completed an action with AutoFill, so any changes can be fed back to a database.
Options
For more complex cases, the autoFill option can be used as an object allowing you to specify specific columns, pre-set column order, etc. In the following case, autoFill.columns is used to allow the fill action on all columns in the table except the first one.
new DataTable('#myTable', {
autoFill: {
columns: ':not(:first-child)'
}
});
Reference
For a complete list of the options that AutoFill supports, please refer to the DataTables initialisation options reference. The AutoFill examples also demonstrate the options available.