Basic initialization
AutoFill gives an Excel like option to a DataTable to click and drag over multiple cells, filling in information over the selected cells and incrementing numbers as needed. AutoFill is initialised using the autoFill option as shown in the example below. This can be set to be true to use the AutoFill configuration defaults, or used as an object to specify options.
Always confirm action
The autoFill.alwaysAsk option can be used to force AutoFill to confirm the action to take, even if there is only one option. This provides the end user with the ability to cancel the action if they made a mistake during the drag. This example shows autoFill.alwaysAsk set to true - to demonstrate, try auto filling a single row or column.
Click focus
The click-to-drag auto fill handle can be attached to the table using a number of different triggers. This is set by the autoFill.focus option: click, focus and hover. The default behaviour is hover, unless KeyTable is also initialised on the same table, in which case focus is used. This example shows the click behaviour. Click a cell to show the auto fill handle. Note that a click outside of the table will cause the handle to be removed.
Column selector
This ability to exclude columns from the AutoFill action can be particularly useful if the table contains non-data columns. This example uses the Select extension for DataTables to allow row selection through the select option, with row selection restricted to the first column. Thus we do not wish to have AutoFill on that column and the selector :not(:first-child) for autoFill.columns enacts that.