【发布时间】:2019-06-25 10:42:17
【问题描述】:
对于给定的列定义,当使用 aggFunc 时,headerName 以 func(string) 格式出现 - 我只希望标题显示我定义的字符串。当 AggFunc 为 null 时,此行为不存在。
const columnDef: any = {
headerName: 'Test',
field: date,
suppressMenu: true,
width: 80,
editable: true,
lockPosition: true,
type: 'numericColumn',
aggFunc: function(data) {
let sum = 0;
data.forEach( function(value) {
if (value) {
sum = sum + parseFloat(value);
}
} );
if (!sum) { return null; }
return sum.toFixed(2);
},
}
headerName 应该显示“test”,但会显示 func(test)。
【问题讨论】:
-
你能在 StackBlitz 上创建一个工作示例吗?
标签: angular typescript ag-grid