Hide TableTools buttons from non-flash devices (iOS, etc.)

Hide TableTools buttons from non-flash devices (iOS, etc.)

jrkohmetscherjrkohmetscher Posts: 5Questions: 0Answers: 0
edited July 2013 in TableTools
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?

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Currently no actually. Perhaps this is something that should be built into TableTools, but at the moment it will just show the buttons when then do nothing. Possibly TableTools should try to do a Flash detection and hide the Flash based buttons when there is no Flash plug-in available.

    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
  • jrkohmetscherjrkohmetscher Posts: 5Questions: 0Answers: 0
    Thanks for the response. I hope to figure out a workaround, and I'll post it here if I do.
  • ltpittltpitt Posts: 4Questions: 0Answers: 0
    edited August 2013
    VERY ugly idea but...

    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...
  • cedriccedric Posts: 1Questions: 0Answers: 0
    @Itpitt

    Any idea how to implement this in Coffeescript? I tried to adapt it with no success.

    Thank you.
This discussion has been closed.