Hide TableTools buttons from non-flash devices (iOS, etc.)
Hide TableTools buttons from non-flash devices (iOS, etc.)
jrkohmetscher
Posts: 5Questions: 0Answers: 0
I'm interested in hiding the buttons when flash is not present. I've tried using swfobject, but it doesn't seem to work for me on Android browsers (and I'm still waiting to hear how iOS works with it). Is there a simpler way to achieve this built into the script?
This discussion has been closed.
Replies
I truly wish there was a suitable HTML5 API for copy to clipboard and save to local file so I could just ditch the Flash component completely - its a real pain!
Allan
If you detect the useragent and init the datatables accordingly (with or without tabletools)?
[code]var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
if(isAndroid) {
$('#example').dataTable();
} else {
$('#example').dataTable( {
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "/swf/copy_csv_xls_pdf.swf"
}
} );
}
[/code]
Code is untested I just wanted to show the idea...
Any idea how to implement this in Coffeescript? I tried to adapt it with no success.
Thank you.