1

codeigniter フレームワークを使用して Web アプリケーションを構築しています。テーブルをデータテーブルから csv および Excel にエクスポートする必要があります。しかし、データテーブル TableTools に sSwfPath をロードしているときにエラーが発生します:

次のライブラリを含めました。

<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データテーブルは次のとおりです:

$(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ファイルを配置したのと同じ場所にメディアファイルを配置しました

//codegen
   // media
   // css
   // jquery

コピー、Excel、印刷ボタンが表示されますが、機能しません。しかし、Excelボタンをクリックしても何も起こりません。私のせいは何ですか?

また、

sSwfPath の読み込み中に 404 エラーが発生する理由を推測できません。

不足しているものがあるか、どこか間違っているかどうか教えてください..

それは大いに役立つでしょう。

前もって感謝します

4

1 に答える 1