Omit certain columns when using autoFill
Omit certain columns when using autoFill
I have a datatable shown below:
I'm trying to use autoFill to allow users to drag values across the whole row however, I do not want the values to go into the columns that are yellow and have the class "weekend". I have managed to grab the class name of the cells using cells[0][0].cell.node().className
on a autoFill event however, I do not know how to stop the values from going into the yellow columns and with the class "weekend"
How do I go about stopping the yellow columns from getting autoFilled?
This question has an accepted answers - jump to answer
Answers
Hi @KelvinDing ,
You can use
autoFill.columns
- I think (haven't tried it) you should be able to use:Cheers,
Colin
Hi @colin ,
Tried with your method before. Seems like it's not working.
Is there a way to do something before the autofill submits the data to the database? Maybe like using .on event?
Cheers,
Kelvin
I have managed to achieve what I want by doing a editor.on('preAutoFill') to filter out the columns with the "publicholiday" class.
Hi @KelvinDing ,
I just tried here, and it's working there as expected. There is an oddity, where if you drag over it (from a column on either side) and release, the autofill does still happen. It only affects the initiation of the drag. I've raised a bug for that one, so hopefully it'll be fixed soon.
Cheers,
Colin