如何将ColReorderWithResize与Datatables javascript上的HTML5按钮相结合
我在我的网站上使用DatabaseJavaScript,带有html5按钮 ,工作正常,但现在我想允许动态调整datatables列的大小,所以我发现了这个 但现在的问题是,我不知道如何将两者结合使用如何将ColReorderWithResize与Datatables javascript上的HTML5按钮相结合,javascript,button,datatables,header,resize,Javascript,Button,Datatables,Header,Resize,我在我的网站上使用DatabaseJavaScript,带有html5按钮 ,工作正常,但现在我想允许动态调整datatables列的大小,所以我发现了这个 但现在的问题是,我不知道如何将两者结合使用 myApp.table = $('#TableId').DataTable( { rowReorder: { update: false }, columnDefs: [ { "width": "5%", "targets": [0] }, { "c
myApp.table = $('#TableId').DataTable(
{
rowReorder: { update: false },
columnDefs: [
{ "width": "5%", "targets": [0] },
{ "className": "text-left custom-middle-align", "targets": [0, 1, 2] },
{ orderable: true, className: 'reorder', targets: 0 },
{ orderable: false, targets: '_all' }
],
autoWidth: false,
sDom: "Rlfrtip", //--> here is the code to resize columns
dom: '<"html5buttons"B>lTfgitp', // here the code to see the buttons
buttons: [
{ extend: 'copy' },
{ extend: 'csv' },
{ extend: 'excel', title: 'ExampleFile' },
{ extend: 'pdf', title: 'ExampleFile' },
{
extend: 'print',
customize: function (win) {
$(win.document.body).addClass('white-bg');
$(win.document.body).css('font-size', '10px');
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
],
myApp.table=$('#TableId').DataTable(
{
行重新排序:{update:false},
columnDefs:[
{“宽度”:“5%”,“目标”:[0]},
{“className”:“文本左自定义中间对齐”,“目标”:[0,1,2]},
{orderable:true,类名:'reorder',目标:0},
{orderable:false,目标:''u all'}
],
自动宽度:false,
sDom:“Rlfrtip”,//-->以下是调整列大小的代码
dom:'lTfgitp',//这里是查看按钮的代码
按钮:[
{extend:'copy'},
{extend:'csv'},
{扩展:“excel”,标题:“ExampleFile”},
{extend:'pdf',title:'ExampleFile'},
{
扩展:“打印”,
自定义:功能(win){
$(win.document.body).addClass('white-bg');
$(win.document.body).css('font-size','10px');
$(win.document.body).find('表')
.addClass('compact')
.css('font-size','inherit');
}
}
],
事实上,我不太理解数据表Rlfrtip和B>ltfgitp使用的代码
提前谢谢
乔利妮丝