让我说我有rowIndex和columnIndex,我想改变这个单元格的背景颜色
答案 0 :(得分:2)
一种方法是扩展默认的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