[英]How to change a color of single cell in spark DataGrid
假設我有rowIndex和columnIndex,我想改變這個單元格的背景顏色
一種方法是擴展默認的itemRenderer並覆蓋set data方法:
override public function set data(value:Object):void {
super.data = value;
// retrieve the value of the list-based control's new public property
var minAge:Number = (listData.owner as MyList).minAge;
if (data.age < minAge) {
listLabel.setStyle("color",0xFF0000);
} else {
listLabel.setStyle("color",0x000000);
}
}
這是一個很好的例子的鏈接:
http://blog.flexdevelopers.com/2009/06/flex-examples-item-renderers-in.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.