我有一个带有自定义itemrenderer的数据网格,用于着色单元格,行和列。当我更改行的颜色时,它有时会完美显示但有时一个或多个单元格没有着色。我没有找到背后的原因。任何人都可以给出任何暗示吗?
以下是我的自定义itemrenderer代码..
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
bd.setStyle("backgroundColor",getStyle("bgColor"));//bordercontainer
lbl.setStyle("fontSize",getStyle("fontSize"));//label in //that bordercontainer
lbl.setStyle("fontFamily",getStyle("fontFamily"));
lbl.setStyle('color', getStyle("fgColor"));
}
我正在使用AdvancedDatagrid并在其中使用styleFunction ..
public function applyFormat(data:Object,col:AdvancedDataGridColumn):Object {
var obj:Object = new Object();
for each(var taskFontFormatVo:TaskFontFormatVo in data.taskFontFormats){
if(!taskFontFormatVo.barchartView ){
if(col.headerText == taskFontFormatVo.columnName){
var bgColor:String = "0x"+taskFontFormatVo.bgColor;
var fgColor:String = "0x"+taskFontFormatVo.fgColor;
var fontSize:Number = taskFontFormatVo.fontSize;
var fontFamily:String = taskFontFormatVo.fontFamily;
obj.bgColor = bgColor;
obj.fgColor = fgColor;
obj.fontSize = fontSize;
obj.fontFamily = fontFamily;
break;
}
}
}
return obj;
}