简体   繁体   English

如何使用导出按钮对数据表中的按钮进行分组?

[英]How to group buttons in datatables with export buttons?

I have a dropdown button with all export buttons coming inside its dropdown and outside I have two more buttons which are not grouping up with Export dropdown button.我有一个下拉按钮,所有导出按钮都在它的下拉菜单内和外面我还有两个按钮没有与导出下拉按钮组合在一起。

buttons: [{
  extend: 'collection',
  text: 'Export',
  className: 'btn btn-sm btn-outline-dark',
  buttons: [{
    extend: 'excel',
    title: 'Re-assigned-Queries'
  }, {
    extend: 'pdf',
    title: 'Re-assigned-Queries'
  }, {
    extend: 'csv',
    title: 'Re-assigned-Queries'
  }]
}, {
  text: 'Select all',
  className: 'btn btn-sm btn-outline-blue',
  action: function() {
    reassignQueryTable.rows().select();
  }
}, {
  text: 'Select none',
  className: 'btn btn-sm btn-outline-red',
  action: function() {
    reassignQueryTable.rows().deselect();
  }
}],

Export button is coming separated from other two buttons and the other two buttons are coming as grouped.导出按钮与其他两个按钮分开,另外两个按钮分组出现。 I want all the 3 buttons to be grouped in one.我希望将所有 3 个按钮合二为一。

在此处输入图片说明

Add a class unique to the button添加按钮独有的类

 extend: 'collection',
  text: 'Export',
  className: 'btn btn-sm btn-outline-dark no-round-right',
  buttons: [{
    extend: 'excel',
    title: 'Re-assigned-Queries'
  },

after that create a css for her之后为她创建一个css

.no-round-right{
    border-radius: 50px 0px 0px 50px;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM