Column grouping show/hide with 'colvis' ?
Column grouping show/hide with 'colvis' ?
I was wondering if theres a way to pair or group columns together into one button while using colvis.
I found an older forumn post asking about it in the depricated ColVis : https://datatables.net/forums/discussion/8052 and wasnt sure if any progress was made on that in the new version.
It looks like the functionality exist in columnToggle, however I would like to add the button into the already existing 'colvis' collection.
For more clarity:
I have these two columns:
one column is a date, the other is just an icon which indicates a state (related to the date). I would like to be able to hide both the date and the icon columns under one button, rather than 2 separate buttons that colvis generates.
Is there a way to do accomplish this?
Thanks,
-Tish
This question has an accepted answers - jump to answer
Answers
Hi @Tishman,
Yep, see this column groups example here.
Cheers,
Colin
Thanks! I looked into it and ended with this result, which is exactly what Im looking for:
Emphasis on the postfixButton line. Thats the code snippet added to make it function how I wanted.