Context
I am using the dataTables plugin with the AutoFill extension. It basically allows you to copy a cell by pulling the cross (bottom-right of it) up or down the column. This works fine in my project.
Problem
However, when I try to copy an input inside of a cell, it clears the selected inputs. Reading the docs, it seems that the older version of the plugin enables the copying of inputs inside cells, just by adding a small script. From the current doc, by looking at the write
option, the behaviour I am looking for should be possible by default:
This callback is the corollary of fnRead, providing a method to customise how AutoFill writes a calculated fill value to a given cell. By default AutoFill will set the value in an input or select element in a cell if found, otherwise it will set the value as HTML.
The thing is, when an input has an initial value, the copying works. But when adding/editing the value, it copies the previous one. It tried to add the read and write function options, but they are never called (see fiddle).
Code
Here's a jsFidle reproducing exactly my issue:
- Drag down row.1 col.1 to row.2 col.1 -> works
- Edit value of row.1 col.1 and repeat step 1 -> goes back to previous value
- Enter value in row.1 col.2 and drag it down -> resets the values without copying
It seems that the value attribute is never updated.