同じページにある DataTables と TableTools の複数のインスタンスに問題があります。DataTables は正常に動作していますが、TableTools を使用すると、最初のテーブルのみがボタンで完全に動作します。
すべてのボタンはすべてのテーブルで正常に表示されますが、ボタンをクリックしても何も起こりません。(「印刷」ボタンを除いて、4つのテーブルすべてで機能します)。
なぜこれが起こっているのか、誰にも考えがありますか?私は解決策を探していましたが、何も見つかりませんでした。
<script type="text/javascript">
jQuery( function( $ ) {
// Implements the dataTables plugin on the HTML table
var $acTable= $("#academic_table").dataTable( {
"oLanguage": {
"sSearch": "Filter:"
},
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"aButtons": [
"copy",
"xls",
"csv",
"pdf",
"print"
]
},
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/academic_serverside.php",
"iDisplayLength": 10,
"bJQueryUI": false,
"sPaginationType": "scrolling",
"sDom": '<"clear"><"top"CTilr<"clear">pt>',
"aoColumns": [
{"bVisible":false},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":false}
],
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
$('td:eq(4)', nRow).html(''+ aData[5] +' '+ aData[6] +'');
},
"oColVis": {
"activate": "mouseover",
"aiExclude": [0,6]
}
}).columnFilter({
aoColumns: [
{ type: "select"},
{ type: "text"},
{ type: "select"},
{ type: "select"},
{ type: "select"},
{ type: "text"},
{ type: "text"}
]
});
// Implements the dataTables plugin on the HTML table
var $buTable= $("#business_table").dataTable( {
"oLanguage": {
"sSearch": "Filter:"
},
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"aButtons": [
"copy",
"xls",
"csv",
"pdf",
"print"
]
},
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/business_serverside.php",
"iDisplayLength": 10,
"bJQueryUI": false,
"sPaginationType": "scrolling",
"sDom": '<"clear"><"top"CTilr<"clear">pt>',
"aoColumns": [
{"bVisible":false},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":false}
],
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
$('td:eq(6)', nRow).html(''+ aData[7] +' '+ aData[8] +'');
},
"oColVis": {
"activate": "mouseover",
"aiExclude": [0,8]
}
}).columnFilter({
aoColumns: [
{ type: "select"},
{ type: "text" },
{ type: "select" },
{ type: "select"},
{ type: "text"},
{ type: "text"},
{ type: "select"},
{ type: "text"}
]
});
// Implements the dataTables plugin on the HTML table
var $lmTable= $("#line_managers_table").dataTable( {
"oLanguage": {
"sSearch": "Filter:"
},
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "print"
}
] },
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/line_managers_serverside.php",
"iDisplayLength": 10,
"bJQueryUI": false,
"sPaginationType": "scrolling",
"sDom": '<"clear"><"top"Tfilr<"clear">pt>'
});
// Implements the dataTables plugin on the HTML table
var $dTable= $("#divisions_table").dataTable( {
"oLanguage": {
"sSearch": "Filter:"
},
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "print"
}
] },
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/divisions_serverside.php",
"iDisplayLength": 20,
"bJQueryUI": false,
"sPaginationType": "scrolling",
"sDom": '<"clear"><"top"Tfilr<"clear">pt>'
});
});
</script>