再後我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