下面是我初始化dataTable的代码
$('#sample-table-2')
.dataTable( {
bAutoWidth: false,
"aoColumns": [
{ "bSortable": false },
null, null,null, null, null,null,
{ "bSortable": false }
],
"aaSorting": [],
// "searching":false,
// "bFilter":null,
// "sSearch":true,
"oLanguage": {"sSearch": '搜索:'},
"sDom":
"<'row'<'col-xs-6'l><'toolbar'f>r>"+
"t"+
"<'row'<'col-xs-6'i><'col-xs-6'p><'bottom'>>",
"oTableTools": {
"aButtons": [
{
"sExtends": "csv",
"sButtonText": "导出Excel",
"sCharSet": "utf8"
}
]
}
} );
$("div.bottom").html('<button style="color:#f78234" onclick="">导出csv文件</button');