对于给定的列定义,当使用 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)。
https://i.stack.imgur.com/xHPMh.jpg https://i.stack.imgur.com/xHPMh.jpg
您需要在您的中将此属性标记为 truegridOptions
.
suppressAggFuncInHeader : true;
根据文档 -
当 true 时,列标题将不包含 aggFunc,例如 'sum(Bank
余额)”将只是“银行余额”。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)