【发布时间】:2026-01-30 20:55:02
【问题描述】:
我正在使用制表符作为 Angular 6 中的树视图结构。我想将两列组合为一列,并为列中可用的图标分配工具提示
以下是我为参考设计的屏幕
sampleColumn= [
{ formatter: this.historyIcon, width: 40, align: "center", cellClick: this.showHistory.bind(this), headerSort: false },
{ formatter: this.mapIcon, width: 40, align: "center", cellClick: this.showMap.bind(this), headerSort: false },
{ field: 'locName', title: 'Location', headerSort: false }
];
mapIcon = function (cell, formatterParams) { //plain text value
return "<i class='fa fa-map-marker'></i>";
};
historyIcon = function (cell, formatterParams) { //plain text value
return "<i class='fa fa-tasks'></i>";
};
var sampleTable = new Tabulator("#child-item-tabulator", {
layout: "fitColumns",
columns: this.sampleColumn,
placeholder: "Fetching data",
virtualDomBuffer: 400,
dataTree: true
});
如何对格式化程序列进行分组并为图标分配工具提示
【问题讨论】: