Colvis (hidden columns by default)
Colvis (hidden columns by default)
I have ColVis checkboxes dropdown, I need to hide specific columns by default (need some specific checkboxes unchecked by default)
Here http://infra.clarin.eu/content/libs/DataTables-1.10.6/extensions/ColVis/examples/title_callback.html is what I can see but we don't have any such option to uncheck some of them.
I have tried to hide columns using "drawCallback" function using its settings parameter but no luck.
What should be the better approach, do we have any existing solution /api for this or we need to write a workaround?
Thank you for your help!
Replies
Hi @michel@advantecpos.com ,
ColVis is actually retired, so it's best to use Buttons to do this. See this example here, where the "Position" column is hidden at table initialisation.
Cheers,
Colin
Hi there,
Thank you for your prompt answer.
I have tried this {"targets":[2,7,8,9,10,11], visible:false }, as solution in shared example and it worked but it is not applied to filter row as you can see on the picture below
Thanks
Please don't post duplicate questions. See answer in your other thread:
https://datatables.net/forums/discussion/54154/column-visibility-drop-down-not-working#latest
Kevin