我正在嘗試向我的資料表添加一個下拉串列以顯示如下按鈕:

我的代碼:
window.jQuery = window.$ = require("jquery");
// boostrap
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
pdfMake.vfs = pdfFonts.pdfMake.vfs;
var datatableSettings = {
select: {
style: "multi",
selector: "td:first-child",
},
dom: "Bfrtip",
buttons: {
buttons: [
{
extend: "collection",
text: "Export",
buttons: [
{ extend: "csv" },
{ extend: "excel" },
{
extend: "pdfHtml5",
orientation: "landscape",
pageSize: "A0",
title: "Users List PDF",
exportOptions: {
modifier: {
page: "current",
...
},
我的問題是顯示了下拉串列但它不起作用:當我單擊匯出以顯示里面的按鈕時,我無法打開下拉串列

uj5u.com熱心網友回復:
您將需要指定text屬性并且不需要指定extend屬性,除非您希望在集合中有下拉按鈕。這對我有用:
buttons: [
{
extend: "collection",
text: "Export",
buttons: [
{ text: "csv" },
{ text: "excel" },
{
text: "pdf",
orientation: "landscape",
pageSize: "A0",
title: "Users List PDF",
exportOptions: {
modifier: {
page: "current",
},
},
},
],
小提琴:
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/395264.html
標籤:javascript 查询 网络包 数据表
上一篇:單擊事件帶來單個用戶的問題
