我已下载example
来自TableTools的。哪个工作正常。我做的是我将index.html的内容复制到另一个文件并关联每个路径。 Flash加载正常,但除了打印按钮外,每个控件都被禁用。可能是什么问题。
<title>TableTools example</title>
<style type="text/css" title="currentStyle">
@import "http://localhost/media/css/demo_page.css";
@import "http://localhost/media/css/demo_table.css";
@import "http://localhost/TableTools/media/css/TableTools.css";
</style>
<script type="text/javascript" charset="utf-8" src="http://localhost/media/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="http://localhost/media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" src="http://localhost/TableTools/media/ZeroClipboard/ZeroClipboard.js"></script>
<script type="text/javascript" charset="utf-8" src="http://localhost/TableTools/media/js/TableTools.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {
$('#example').dataTable( {
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "http://localhost/TableTools/media/swf/ZeroClipboard.swf"
}
} );
} );
</script>
答案 0 :(得分:2)
基本上问题在于错误地指定swf路径。
"sSwfPath": "http://localhost/TableTools/media/swf/ZeroClipboard.swf"
尝试用
替换此路径"sSwfPath": "../media/swf/ZeroClipboard.swf"
答案 1 :(得分:1)
尝试此网址:
,而不是本地文件的sSwfPath值 http://datatables.net/release-datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf
由于某些原因,这为我提供了功能,但本地文件没有。
答案 2 :(得分:0)
认为这会有所帮助
"sDom": 'T<"H"plfr>t<"F"ip>',
"oTableTools": {
"aButtons": [ "csv", "pdf" ],
"sSwfPath": "https://datatables.net/release-datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
}