Flex 사용자 정의 datagrid 셀 글꼴

<mx:DataGrid width="90%" id="dg" height="500" >
			<mx:columns>
				<mx:DataGridColumn headerText="Id" dataField="id" />
				<mx:DataGridColumn headerText="Name" dataField="notename">
				<mx:itemRenderer> 
						<mx:Component> 
						<mx:Label textAlign="center" >
						<mx:Script> 
							<![CDATA[ 
							 override public function set data(value:Object) : void
					        {
					        	toolTip = value.remark;
					        	this.text = value.notename;
					        }
					    	]]> 
						</mx:Script> 
						</mx:Label>
						</mx:Component> 
						</mx:itemRenderer>
				</mx:DataGridColumn>
                  <mx:DataGridColumn headerText="Cost" dataField="cost"   >
				<mx:itemRenderer> 
						<mx:Component> 
						<mx:Label textAlign="center"   > 
						<mx:Script> 
							<![CDATA[ 
							 override public function set data(value:Object) : void
					        {
					        	toolTip = value.remark;
					        	
					            super.data = value;
					            if( String(value.cost).charAt(0)=='-')
					            {
					            // Label htmlText , html 
					            this.htmlText = '<font color="#00DB00">' + String(value.cost)+ '</font>';  
					                                      
					            }
								else{
								this.htmlText = '<font color="#FF0000">' + String(value.cost)+ '</font>';          
								}
					         }   
							]]> 
						</mx:Script> 
						</mx:Label> 
						</mx:Component> 
					</mx:itemRenderer> 
				</mx:DataGridColumn>
			</mx:columns>
		</mx:DataGrid>

좋은 웹페이지 즐겨찾기