Export data hidden by Responsive whilst avoiding columns hidden by colvis
Export data hidden by Responsive whilst avoiding columns hidden by colvis

Exporting data hidden by Responsive whilst avoiding columns hidden by colvis
I've been looking in vain for a way to do this since "display: none"
is used in both cases. columns: ':visible'
neatly excludes the columns hidden by colvis but also misses the columns hidden by Responsive which I want to include. I've tried other selectors, combining options and a few other things but I can't get past exporting either none of the hidden columns or all of them. Is there a way to select the columns i want?
Answers
You can use a function for the
exportOptions
- and in there callcolumns.visible()
. That function returns true/false based on the colvis visibility, rather than the Responsive behaviour. See example here.Colin
Thanks but that link is to something dead. Can you put some information here?
Here is the correct link to
columns().visible()
. Did you look at the example Colin posted? I think that will do what you want.Kevin
Hi,
Thanks. Yes but you didn't or you'd have seen that that's what's broken. Obviously I can find the Columns API myself.
Cheers.
Colin's link (See example here ) does work. Here is the link:
http://live.datatables.net/dodumaso/1/edit
Or, is there something in the example that isn't working?
Kevin
Hi,
No, it doesn't. That's the point. Both of those links return:
Thanks.
http://live.datatables.net/dodumaso/1/edit
This works for me, see the screenshot:
I copied the code to jsfiddle in case you have issues accessing http://live.datatables.net/ in general:
https://jsfiddle.net/oketunwc/
Kevin