我正在尝试根据同一行中另一个单元格中的值格式化一个 ExtJS treegrid 单元格。下面是我目前如何对其进行编码的概述。但是,这目前不起作用,因此我将不胜感激任何建议。谢谢!
function fn(v, values){
if (values.alarm == 1) {
return '<span style="color: red;">' + v + '</span>';
}
return v;
}
//new treegrid
columns:[{
header: 'H1',
width: 60,
dataIndex: 'duration1',
align: 'center',
tpl: new Ext.XTemplate(
'{duration1:this.doFormat}',
{doFormat: fn()}
)
}, {
header: 'A1',
width: 60,
dataIndex: 'alarm1',
align: 'center'
}]