制表符总行数(列计算)也被导出

Tabulator total Rows count (Column Calculations) gets exported as well

我正在使用这种方法来显示 table:

中的总行数
var tabulator_table = new Tabulator("#example", {

                        columns: [

                            { title: "name", field: "name", bottomCalc: "count", headerFilter: "input" },
                            { title: "Type", field: "Type", bottomCalc: "count", headerFilter: "input" },
                        ],
                        dataFiltered: function (filters, rows) {
                            var el = document.getElementById("search_count");
                            el.innerHTML = rows.length;
                        },
                        dataLoad: function (data) {
                            var el = document.getElementById("total_count");
                            el.innerHTML = data.length;
                        },
                    });
  var total_count = $(".tabulator-footer").find('.tabulator-cell:first-child()').text();
                    $("#total_count").text(total_count);


$(".tabulator-footer").append("<span class='search_count' id='search_count'></span> Of<span class='search_result'>Total Productions: <span class='total_count'></span></span>")

                    var totalsearch = $("#total_count").text();
                    var resultsearch = $("#search_count").text();
                    $(".total_count").text(totalsearch)
                    $(".search_count").text(totalsearch);
//This CSS will hide the footer:
   .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {
                    display: none;
                }

这很好,但有一个问题:当我点击导出到 excel 时,它也会导出计算行,例如:

如何停止导出计数行 (1 1) 或是否有其他方法显示总行数。 这是导出函数:

document.getElementById("myButtons").addEventListener("click", function () {
                        tabulator_table.download("xlsx", "name.xlsx", { sheetName: "Info" });
                    });

我认为您只需要 table 选项中的 downloadConfig 选项即可。 http://tabulator.info/docs/4.6/download#advanced-config

因此,只需将 downloadConfig: {columnCalcs: false} 添加到您的 table 选项中即可。

这是一个工作示例。 https://jsfiddle.net/nrayburn/0hn6v48r/11/