g_simpool_vom_table = $('#' + simpool_vom_table_id).DataTable({
"language": {
"lengthMenu": "每页 _MENU_",
"zeroRecords": "没有找到记录",
"info": "第 _PAGE_ 页 (总共 _PAGES_ 页 )",
"infoEmpty": "无记录",
"infoFiltered": "(从 _MAX_ 条记录过滤)",
"sSearch": "搜索",
"oPaginate": {
"sFirst": "第一页",
"sPrevious": " 上一页 ",
"sNext": " 下一页 ",
"sLast": " 最后一页 "
}
},
"destroy": true,
"paging": true,
"pagingType": "simple_numbers", // simple, numbers, simple_numbers, full, full_numbers, first_last_numbers
"lengthMenu": [5, 10, 20, 50, 100],
"pageLength": 10,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"select": 'single',
"autoWidth": true,
"deferRender": true, // 延迟渲染,加速界面加载.
"fixedHeader": true,
"scrollX": false,
"scrollY": false,
"scrollCollapse": true,
"stripeClasses": ['odd', 'even'],
"dom": '<"row"<"col-lg-1"<"toolbar">><"col-lg-4"B><"col-lg-7"f>>t<"row"<"col-lg-2"l><"col-lg-3"i><"col-lg-7"p>>',
// "dom": '<"row"<"col-lg-4"B><"col-lg-8"f>>t<"row"<"col-lg-2"l><"col-lg-3"i><"col-lg-7"p>>',
"buttons": {
// 'copy', 'csv', 'excel', 'pdf', 'print'
"buttons": [{
extend: 'copy',
text: '<i class="fa fa-qrcode"></i>',
className: 'btn btn-warning btn-flat'
},
{
extend: 'csv',
text: '<i class="fa fa-file-excel-o"></i>',
className: 'btn btn-warning btn-flat',
title: 'Mote Lists-' + new Date()
},
{
extend: 'print',
text: '<i class="fa fa-print"></i>',
className: 'btn btn-warning btn-flat',
title: 'Mote Lists-' + new Date()
}
]
},
"aoColumns": columnDefines,
"ajax": {
url: ajaxUrl,
data: ajaxPara,
dataType: 'json',
type: "POST",
dataSrc: '' //""=[],即普通Arr, datarow:{"datarow": []}
}
});
//toolbar
$("#simpool_vom_table_pdiv div.toolbar").html(getSimPoolVomTabToolBar());
//创建
$("#btn_flow_add").unbind("click");
$("#btn_flow_add").on("click", function() {
btn_flow_add_click();
});
情况如图
tr宽度?td的宽度吧?
两个配置项:
参考API:autowidth、columns.width