Notice
Recent Posts
Recent Comments
SNOWFLAKES DRAWING PAPER
TEST_BackgroundColorControlDataGrid (+filterFunction) 본문
개발/FLEX/AS3/AIR/BlazeDS
TEST_BackgroundColorControlDataGrid (+filterFunction)
눈송2 2009. 10. 28. 13:31package com
{
import mx.controls.DataGrid;
public class RowBGDataGrid extends DataGrid
{
/**
* 값의 색 설정
* {무해:0xFF8000,위험:0xFF0000...}
*/
private var _rowColors:Object;
public function get rowColors():Object
{
if (!_rowColors)
return {};
return _rowColors;
}
public function set rowColors(value:Object):void
{
_rowColors = value;
}
/**
* 체크할 속성명
* dataProvider[i][chkPropertyName]
*/
private var _chkPropertyName:String;
public function get chkPropertyName():String
{
if (!_chkPropertyName)
return "";
return _chkPropertyName;
}
public function set chkPropertyName(value:String):void
{
_chkPropertyName = value;
}
public function RowBGDataGrid()
{
}
override protected function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void
{
var item:Object;
if(dataIndex < dataProvider.length)
{
item = dataProvider[dataIndex];
if (rowColors[item[chkPropertyName]] != undefined)
color = rowColors[item[chkPropertyName]];
}
super.drawRowBackground(s, rowIndex, y, height, color, dataIndex);
}
}
}
'개발 > FLEX/AS3/AIR/BlazeDS' 카테고리의 다른 글
[FLEX] Flex 3 datavisualization.swc lock 풀기 (0) | 2009.11.19 |
---|---|
[FLEX] Flex3 에 추가된 라이브러리~ (0) | 2009.11.19 |
[FLEX] Popup시 모달 스타일 설정 (0) | 2009.10.07 |
10 Things Every Senior Flash Developer Should Know (0) | 2009.09.18 |
[FLEX] 차트사용하기위한 라이브러리 파일 확인 (0) | 2009.09.02 |
Comments