制表符打印单击的行 - 打印 PDF?

Tabulator Print the clicked row - Print PDF?

我正在寻找是否可以将打印按钮添加到制表符行并在单击它时打印该特定行?

http://tabulator.info/docs/4.3/print

谢谢

没有为此内置的功能,但您可以轻松地组合一些东西来实现它。此示例假定每一行都有一个唯一的 id 字段。

您可以使用自定义格式化程序来创建 Button Column,然后使用它将 table 过滤到该行,然后打印 table,然后清除过滤器:

//custom formatter definition
var printIcon = function(cell, formatterParams, onRendered){ //plain text value
    return "<i class='fa fa-print'></i>";
};

//column definition in the columns array
{formatter:printIcon, width:40, align:"center", cellClick:function(e, cell){ 

    //filter table to just this row
    table.Filter(function(data){
        return data.id == cell.getData().id;
    });

    //print the table
    table.print();

    //clear the filter
    table.clearFilter();
}},