Clone only visible columns
Clone only visible columns
Project
Posts: 1Questions: 1Answers: 0
Hi, i'm doing a datatable filter on head using the example Column filtering: https://datatables.net/extensions/fixedheader/examples/options/columnFiltering.html
I want to clone only the visible columns, is it possible? How can i do?
Thanks in advance
Luca
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi Luca,
That example you gave is cloning a whole new header row, so that would be for all columns, whether visible or not.
When it creates the input cells in the
each()
loop, you could test for visibility there withcolumn().visible()
, but it would be probably just as efficient to create it for all columns. The test would be something like:Cheers,
Colin