TableTools is not working [code incl]
TableTools is not working [code incl]
sjur
Posts: 4Questions: 1Answers: 0
I've been trying for two days to get this working. I've read the forums and looked on stackoverflow but I'm not making progress.
I've managed to get a working example BUT....
clicking the export buttons does nothing and there is no error output on the console.
Can someone show me how to make the below example work?
OR
Here's an example of the code using Bootstrap in JSFiddle. Again, Clicking the export buttons has no action.
<html>
<head>
<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css" href="http://datatables.net/download/build/nightly/jquery.dataTables.css">
<!-- DataTables.tableTools CSS -->
<link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/tabletools/2.2.2/css/dataTables.tableTools.css">
<!-- Base jQuery -->
<script type="text/javascript" charset="utf8" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<!-- DataTables -->
<script type="text/javascript" charset="utf8" src="http://datatables.net/download/build/nightly/jquery.dataTables.js"></script>
<!-- tableTools -->
<script type="text/javascript" charset="utf8" src="http://cdn.datatables.net/tabletools/2.2.2/js/dataTables.tableTools.js"></script>
</head>
<script>
$(document).ready(function() {
$('#example').DataTable( {
dom: 'T<"clear">lfrtip',
tableTools: {
"sSwfPath": "http://cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls_pdf.swf"
}
} );
} );
</script>
<body>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
</tbody>
</table>
</body>
</html>
This discussion has been closed.
Answers
Update:
I'm still struggling with this.. Any help appreciated greatly. This is hugely frustrating.
Here's an example of the code using Bootstrap in JSFiddle. Again, Clicking the export buttons has no action.
http://jsfiddle.net/h2bof5cr/