数据表TableTools-找不到sSwfPath的路径 [英] Datatables TableTools - Not able to find the path for sSwfPath
问题描述
我正在使用codeigniter框架来构建我的Web应用程序.我需要将我的表从数据表导出到csv和excel.但是在数据表TableTools中加载sSwfPath时出现错误:
I am using codeigniter framework to build my web application. I need to export my table from datatables to csv and excel. But I am getting an error while loading the sSwfPath in the datatables TableTools :
我包括以下库:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://localhost/codegen/assets/js/jquery.dataTables.js" type="text/javascript"></script>
<script src="http://localhost/codegen/js/jquery.dataTables.columnFilter.js" type="text/javascript"></script>
<script src="http://localhost/codegen/media/js/ZeroClipboard.js" type="text/javascript"></script>
<script src="http://localhost/codegen/media/js/TableTools.js" type="text/javascript"></script>
我的jquery数据表如下:
And my jquery datatables is as follows :
$(document).ready(function(){
var oTable = $('#datatables').dataTable({
"sPaginationType":"full_numbers",
"sDom": 'Tlfrtip',
"oTableTools": {
"sSwfPath": "<?php base_url();?>/application/libraries/jQuery/media/swf/copy_cvs_xls_pdf.swf" // 404 error - File not found
},
"sScrollX": "100%",
"bScrollCollapse": true,
"bAutoWidth": true,
"aaSorting":[[0, "asc"]],
"bJQueryUI":true
}).columnFilter({
aoColumns: [ null,
null,
{ type: "select", values: [ 'male', 'female'] },
null,
null,
null,
null,
{ type: "select", values: [ '1', '2', '3', '4', '5', '6', '7','8','9','10'] },
{ type: "select", values: [ 'A', 'B', 'C'] },
null,
{ type: "select", values: ['P', 'A'] },
null,
null,
null
]
});
});
当我使用codeigniter时,我已将媒体文件放置在放置所有jquery css文件的同一位置
As I am using codeigniter I have placed my media file in the same place where I have placed all my jquery css files
//codegen
// media
// css
// jquery
它显示复印","Excel",打印"按钮,但不起作用. 但是,当我单击Excel按钮时,仍然没有任何反应.我怎么了?
its showing Copy, Excel, Print button but not working. but still when i click on Excel button nothing is happening. what is my fault?
还
我无法猜测为什么加载sSwfPath时会出现404错误?
I am not able to guess why I am getting 404 error while loading sSwfPath ?
请让我知道是否缺少任何东西,或者我在任何地方错了.
Please let me know if there is anything missing or whether I am wrong anywhere..
那将有很大的帮助.
预先感谢
推荐答案
它不在媒体文件夹中.当您从datatables.net下载整个src代码时,它位于文件夹名称"extra"中,与媒体文件夹处于同一级别.
its not in the media folder. when you download the whole src code from datatables.net , it's in a folder name "extra", its in the same level as the media folder.
这篇关于数据表TableTools-找不到sSwfPath的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!