制表符:打印输出功能不会在 table 中打印出进度条
Tabulator: the print out function doesn't print out the progress bar in table
我正在使用 Tabulator 创建 table 并添加一个按钮来打印 table,但是,当我单击该按钮时,它会在我的 table 中显示进度条不显示在打印结果中。有谁知道为什么我不能打印出进度条?谢谢。
var tabledata = [{
id: 1,
name: "postp_ckmb_ngml_group_>=5.6",
confidence: "1.08",
acceptable: "true"
},
{
id: 2,
name: "pci_status_cd_急诊",
confidence: "1.05",
acceptable: "true"
},
{
id: 3,
name: "conclision_angiography_type_冠脉三支病变",
confidence: "1.01",
acceptable: "true"
},
{
id: 4,
name: "pci_indication_cd_STEMI的紧急PCI治疗",
confidence: "0.89",
acceptable: "true"
},
{
id: 5,
name: "postp_bnp_pnml_group_>500",
confidence: "0.82",
acceptable: "true"
},
{
id: 6,
name: "postp_bnp_pnml_group_100-500",
confidence: "0.82",
acceptable: "true"
},
{
id: 7,
name: "cad_presentation_cd_STEMI(7天)",
confidence: "0.79",
acceptable: "true"
},
{
id: 8,
name: "pci_status_cd_早期",
confidence: "0.64",
acceptable: "true"
},
{
id: 9,
name: "cad_presentation_cd_Non-STEMI(7天)",
confidence: "0.61",
acceptable: "true"
},
{
id: 10,
name: "if_pior_cvd_1.0",
confidence: "0.37",
acceptable: "true"
}
];
const table = new Tabulator("#tableContainer", {
data: tabledata,
height: "292px",
layout: "fitColumns",
printAsHtml: true,
printCopyStyle: true,
printHeader: "<h3>Feature Selection Results<h3>",
columns: [{
title: "",
field: "id",
width: 50
},
{
title: "Feature",
field: "name"
},
{
title: "Confidence",
field: "confidence",
sorter: "number",
align: "left",
formatter: "progress",
width: 400,
formatterParams: {
mix: 0,
max: 1.1,
color: ["#296FAB"],
legend: true,
legendColor: "#333333",
legendAlign: "right"
}
},
{
title: "Acceptability",
field: "acceptable",
align: "center",
editor: true,
sorter: "boolean",
formatter: "tickCross",
width: 150
},
],
});
const printTable = () => {
table.print(false, true);
}
<script src="https://unpkg.com/tabulator-tables@4.3.0/dist/js/tabulator.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/tabulator/4.3.0/css/tabulator.min.css" rel="stylesheet" />
<button onclick="printTable()">Print
</button>
<div id="tableContainer"></div>
我想使用打印按钮打印出整个table包括进度条。
这是原始 Tabulator 打印系统的一个限制,它只能处理基于文本的格式化程序
从 2020 年年中发布的 4.6 版开始,打印图形格式化程序应该没有问题
我正在使用 Tabulator 创建 table 并添加一个按钮来打印 table,但是,当我单击该按钮时,它会在我的 table 中显示进度条不显示在打印结果中。有谁知道为什么我不能打印出进度条?谢谢。
var tabledata = [{
id: 1,
name: "postp_ckmb_ngml_group_>=5.6",
confidence: "1.08",
acceptable: "true"
},
{
id: 2,
name: "pci_status_cd_急诊",
confidence: "1.05",
acceptable: "true"
},
{
id: 3,
name: "conclision_angiography_type_冠脉三支病变",
confidence: "1.01",
acceptable: "true"
},
{
id: 4,
name: "pci_indication_cd_STEMI的紧急PCI治疗",
confidence: "0.89",
acceptable: "true"
},
{
id: 5,
name: "postp_bnp_pnml_group_>500",
confidence: "0.82",
acceptable: "true"
},
{
id: 6,
name: "postp_bnp_pnml_group_100-500",
confidence: "0.82",
acceptable: "true"
},
{
id: 7,
name: "cad_presentation_cd_STEMI(7天)",
confidence: "0.79",
acceptable: "true"
},
{
id: 8,
name: "pci_status_cd_早期",
confidence: "0.64",
acceptable: "true"
},
{
id: 9,
name: "cad_presentation_cd_Non-STEMI(7天)",
confidence: "0.61",
acceptable: "true"
},
{
id: 10,
name: "if_pior_cvd_1.0",
confidence: "0.37",
acceptable: "true"
}
];
const table = new Tabulator("#tableContainer", {
data: tabledata,
height: "292px",
layout: "fitColumns",
printAsHtml: true,
printCopyStyle: true,
printHeader: "<h3>Feature Selection Results<h3>",
columns: [{
title: "",
field: "id",
width: 50
},
{
title: "Feature",
field: "name"
},
{
title: "Confidence",
field: "confidence",
sorter: "number",
align: "left",
formatter: "progress",
width: 400,
formatterParams: {
mix: 0,
max: 1.1,
color: ["#296FAB"],
legend: true,
legendColor: "#333333",
legendAlign: "right"
}
},
{
title: "Acceptability",
field: "acceptable",
align: "center",
editor: true,
sorter: "boolean",
formatter: "tickCross",
width: 150
},
],
});
const printTable = () => {
table.print(false, true);
}
<script src="https://unpkg.com/tabulator-tables@4.3.0/dist/js/tabulator.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/tabulator/4.3.0/css/tabulator.min.css" rel="stylesheet" />
<button onclick="printTable()">Print
</button>
<div id="tableContainer"></div>
我想使用打印按钮打印出整个table包括进度条。
这是原始 Tabulator 打印系统的一个限制,它只能处理基于文本的格式化程序
从 2020 年年中发布的 4.6 版开始,打印图形格式化程序应该没有问题