带有 pdf、csv、xls 和复制选项的数据表的 tabletool 问题
Issue with tabletool of datatable with pdf, csv, xls and copy options
sTable = $('#s').dataTable({
"bVisible":"True",
"dom": 'T<"clear">lfrtip',
"tableTools": {
"sSwfPath": "https://cdn.datatables.net/tabletools/2.1.1/swf/copy_csv_xls_pdf.swf",
"aButtons": [
"copy",
"csv",
"xls",
"pdf",
"print",
"select_all",
"select_none"
]
}
});
按钮显示正常,但 copy、csv、xls、pdf 不工作,我没有收到任何 404,我已在浏览器控制台中检查过,但我正在加载总数据表和按钮的容器过滤器按钮。这可能会导致问题,请帮助我。
您的浏览器 Adobe Flash Player 插件已被禁用、对该特定页面已禁用或根本未安装。
- 在 chrome 中启用闪光灯 -> https://support.google.com/chrome/answer/108086?hl=en
- 在 FireFox 中启用 flash -> https://helpx.adobe.com/flash-player/kb/enabling-flash-player-firefox.html
- 在 IE 中启用 flash -> https://helpx.adobe.com/flash-player/kb/install-flash-player-windows.html
终于找到了解决方案,而且效果很好..
问题是我的按钮是隐藏的,所以在初始化时它没有得到我的 tabletool 按钮的高度和宽度。所以我创建了一个回调函数,它添加了按钮的宽度和高度。
funtion m(){
$('[id^=ToolTables_] embed').each(function( index ) {
$(this).attr('width','47px');
$(this).attr('height','47px');
});
}
sTable = $('#s').dataTable({
"bVisible":"True",
"dom": 'T<"clear">lfrtip',
"tableTools": {
"sSwfPath": "https://cdn.datatables.net/tabletools/2.1.1/swf/copy_csv_xls_pdf.swf",
"aButtons": [
"copy",
"csv",
"xls",
"pdf",
"print",
"select_all",
"select_none"
]
}
});
按钮显示正常,但 copy、csv、xls、pdf 不工作,我没有收到任何 404,我已在浏览器控制台中检查过,但我正在加载总数据表和按钮的容器过滤器按钮。这可能会导致问题,请帮助我。
您的浏览器 Adobe Flash Player 插件已被禁用、对该特定页面已禁用或根本未安装。
- 在 chrome 中启用闪光灯 -> https://support.google.com/chrome/answer/108086?hl=en
- 在 FireFox 中启用 flash -> https://helpx.adobe.com/flash-player/kb/enabling-flash-player-firefox.html
- 在 IE 中启用 flash -> https://helpx.adobe.com/flash-player/kb/install-flash-player-windows.html
终于找到了解决方案,而且效果很好.. 问题是我的按钮是隐藏的,所以在初始化时它没有得到我的 tabletool 按钮的高度和宽度。所以我创建了一个回调函数,它添加了按钮的宽度和高度。
funtion m(){
$('[id^=ToolTables_] embed').each(function( index ) {
$(this).attr('width','47px');
$(this).attr('height','47px');
});
}