有没有办法在制表符中获取列 header 的鼠标悬停事件?

Is there a way to get a mouseover event for a column header in tabulator?

我没有看到列 header 的鼠标悬停事件,而且它似乎没有触发行鼠标悬停或单元格鼠标悬停(这是有道理的)。 谢谢。 -jpr

制表符中 headers 列的鼠标悬停事件处理没有内置选项。

Column Callbacks Documentation 包含可用回调的完整列表。

话虽如此,您可以使用自定义列 header 标题格式化程序自己添加回调:

var customTitleFormatter = function(cell){

    var headerEl = cell.getElement().parentNode.parentNode; //get the column header element from above the title element

    headerEl.addEventListener("mouseover", function(e){
        //do something
    });

    return cell.getValue(); // ensure the title is set on the cell
}

然后在列定义中将其分配给列

{title:"Name", field:"name", titleFormatter:customTitleFormatter}