再后我previous question,因为我没有得到任何满意的答复DataTables TableTools插件 - 如何在Codeigniter中配置sSwfPath路径?
的问题如下:
我已经给我的代码在JSBin http://live.datatables.net/aqowib/2对此我不能链接到sSwfPath正常。我使用codeiginter在我的应用程序,所以我想如下加载文件:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://<?php base_url(); ?>/assets/js/jquery.dataTables.js" type="text/javascript"></script>
<script src="http://<?php base_url(); ?>/js/jquery.dataTables.columnFilter.js" type="text/javascript"></script>
<script src="http://<?php base_url(); ?>/media/js/ZeroClipboard.js" type="text/javascript"></script>
<script src="http://<?php base_url(); ?>/media/js/TableTools.js" type="text/javascript"></script>
而且我的脚本标签包含以下代码:
$(document).ready(function(){
var oTable = $('#datatables').dataTable({
"sPaginationType":"full_numbers",
"sDom": 'Tlfrtip',
"oTableTools": {
"sSwfPath": "<?php base_url();?>/media/swf/copy_cvs_xls_pdf.swf"
},
"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
]
});
});
每次我收到404错误,指出无法加载SWF文件 - 请检查SWF路径
请帮我,我错在哪里? 在此先感谢。
那不是意味着你的''返回一个错误的值? –
berbt
2014-06-30 14:41:01
亲爱的NealCaffrey,我们如何在laravel 4.2页面中使用sSwfPath?请给出建议 – sujivasagam 2015-07-15 09:10:11
虽然这可能解决了你的问题,但这不是造成问题的原因。你忘了使用回声,所以berbt是对的。部件'<?php base_url();?>'不返回值。查看Vishav B Kaith的答案。 – RWC 2015-11-25 14:09:37