1、 设置DataGrid单元格颜色
package com.tjsoft.base.common.page
{
import flash.display.Sprite;
import mx.controls.DataGrid;
public class ColorsDataGrid extends DataGrid
{
public function ColorsDataGrid()
{
super();
}
/**
*
* 设置单元格背景颜色
*
* */
override protected function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void
{
if(rowIndex%2==1)
{
color=0xffffff; //偶数行
}else{
color=0xefefef; //奇数行
} super.drawRowBackground(s,rowIndex,y,height,color,dataIndex);
}
}
}
package com.tjsoft.base