I cannot get the CSV and Copy buttons to do anything. The SWF file is loading correctly and is definitely working, but clicking on the CSV and Copy buttons does nothing. I've even added an alert to click event in TableTools.js (below), but it's never reached!?
I should add that I'm running this from a file:// hosted html file (not a web server) ,and the table is dynamically generated (see below). I've tried with static data, but that made no difference.
Any ideas?
And here's the generated markup:
"fnClick": function( nButton, oConfig, flash ) { alert("!"); this.fnSetText( flash, this.fnGetTableData(oConfig) ); }
I should add that I'm running this from a file:// hosted html file (not a web server) ,and the table is dynamically generated (see below). I've tried with static data, but that made no difference.
Any ideas?
var tbl = $('table#export tbody'); var addRows = $.indexedDB("customerDB").objectStore("customerStore").each(function (elem) { tbl.append("<tr><td>" + elem.value.name + "</td><td>" + elem.value.jobTitle + "</td><td>" + elem.value.company + "</td><td>" + elem.value.emailAddress + "</td></tr>"); }); addRows.promise().done(function() { // Table generation complete $('table#export').dataTable({ "bPaginate": false, "bLengthChange": false, "bFilter": false, "bSort": false, "bInfo": false, "bAutoWidth": false, "sDom": 'T<"clear">lfrtip', "oTableTools": { "sSwfPath": "assets/jquery-dataTables/extras/tableTools/media/swf/copy_csv_xls_pdf.swf", "aButtons": [ { "sExtends": "copy", "sButtonText": "Copy to Clipboard" }, { "sExtends": "csv", "sButtonText": "Export to Excel" } ] } }); });
And here's the generated markup:
<div id="export_wrapper" class="dataTables_wrapper" role="grid"> <div class="DTTT_container"> <a class="DTTT_button DTTT_button_copy" id="ToolTables_export_0"> <span>Copy to Clipboard</span> <div style="position: absolute; left: 0px; top: 0px; width: 131px; height: 29px; z-index: 99;"> <embed id="ZeroClipboard_TableToolsMovie_1" src="assets/jquery-dataTables/extras/tableTools/media/swf/copy_csv_xls_pdf.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="131" height="29" name="ZeroClipboard_TableToolsMovie_1" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=1&width=131&height=29" wmode="transparent" /> </div> </a> <a class="DTTT_button DTTT_button_csv" id="ToolTables_export_1"> <span>Export to Excel</span> <div style="position: absolute; left: 0px; top: 0px; width: 106px; height: 29px; z-index: 99;"> <embed id="ZeroClipboard_TableToolsMovie_2" src="assets/jquery-dataTables/extras/tableTools/media/swf/copy_csv_xls_pdf.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="106" height="29" name="ZeroClipboard_TableToolsMovie_2" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=2&width=106&height=29" wmode="transparent" /> </div> </a> </div> <div class="clear"></div> <table id="export" class="dataTable"> <thead> <tr role="row"> <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1">Name</th> <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1">Job Title</th> <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1">Company</th> <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1">Email Address</th> </tr> </thead> <tbody role="alert" aria-live="polite" aria-relevant="all"> <tr class="odd"> <td class=" ">Test Data</td> <td class=" ">Developer</td> <td class=" ">Apple</td> <td class=" ">test.data@apple.com</td> </tr> </tbody> </table> </div>