其实我想在Datatable上使用Print按钮。我也可以实现这一点..当点击打印按钮时,它显示了打印视图,但是tbody变空了......根本没有行..
我的代码如下:
$("#Book").dataTable().fnDestroy();
oTable = $('#Book').dataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"aButtons": [
"copy",
"print",
{
"sExtends": "collection",
"sButtonText": "Save",
"aButtons": ["csv", "xls", "pdf"]
}
]
},
});
<table id="Book" class="table table-striped table-bordered table-hover table-checkable" style="padding-top: 100px">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
<th>Column 5</th>
<th>Column 6</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
然后我在输出上有这样的打印按钮
但点击打印按钮后,它没有显示任何像这样的行
如果我单击“保存”按钮本身,则不会以任何格式保存。
请帮我解决这个问题..