Flex ListÐб³¾°É«
¹ýÈ¥ÔÚ¶ÔDataGridÉèÖÃÐб³¾°É«Ê±£¬¸Ð¾õ»¹ÊÇͦ·½±ãµÄ£¬Ö»ÒªÖØÐ´DataGridµÄ£¬ÈçÏÂ
private var _rowColorFunction:Function;
public function set rowColorFunction(f:Function):void
{
this._rowColorFunction = f;
}
public function get rowColorFunction():Function
{
return this._rowColorFunction;
}
override protected function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void
{
if (this.rowColorFunction != null) {
if (dataIndex < this.dataProvider.length) {
var item:Object = this.dataProvider.getItemAt(dataIndex);
color = this.rowColorFunction.call(this, item, color);
}
}
super.drawRowBackground(s, rowIndex, y, height, color, dataIndex);
}
Èç¹ûÄ㻹ÊDz»ÊǺÜÃ÷°×¿ÉÒԲο¼ÎÒÒÔǰµÄ²©¿Íhttp://blog.csdn.net/terryzero/archive/2009/10/12/4657277.aspx
½ñÌìÎÒÅöµ½¸öÐèÇóÊÇÒª¶ÔListÐбäÉ«£¬ÓÉÓÚÎÒÏëDataGridºÍList¶¼ÊǼ̳ÐÓëListBase,¶¼ÓÐ override protected function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void
Õâ¸ö·½·¨£¬ËùÒÔÎÒ¾ÍÏ뵱Ȼ£¬ÕÕºù«»Æ°£¬Ò²ÖØÐ´ÁËÕâ¸ö·½·¨£¬µ«¾¹ýµ÷ÊÔÔõôҲµ÷Óò»µ½Õâ¸ö·½·¨¡£¸ãµÄÎҷdz£·Ñ½â£¬ÄѵÀÕâ¸ö·½·¨Ã»Óõİ¡£¿ÍøÉϲéÁ˺þ㬹úÄÚûɶÕâ·½ÃæµÄºÃÎÄÕ£¬Í»È»Ò»Æª¹úÍâµÄÎÄÕÂÆô·¢ÁËÎÒ¡£ÈçÏÂ
All the listy components in Flex (List, Datagrid, Tree, etc.) have a protected method called drawRowBackground which is in charge of drawing the background for a given row. You typically use it to color a given row based on some facet of the data the row represents (e.g. red background for rows with a negative bank balance).
With DataGrid, it's easy to use, just subclass DataGrid and override the method, parameterized so you can pass in a function to compute the color for each row based on the row index/data/original color/etc. With List (and since ComboBox uses a
Ïà¹ØÎĵµ£º
ÔÚmxmlµÄapplicationÀà¿ÉÒÔͨ¹ýgeturl»ñÈ¡µ±Ç°url¡£»ñÈ¡url¿ÉÒÔÌṩһ¸öºÜºÃµÄ·½Ê½¶Ôswf´©²ÎÊý¡£ÔÚ¹«Ë¾µÄÏîÄ¿ÖоʹóÁ¿µÄÓ¦ÓÃÏà¹ØµÄ¼¼Êõ¡£¾ÍºÍ´ó¼Ò·ÖÏíÒ»ÏÂÏà¹ØµÄд·¨£¬Èç¹ûд²»ºÃ¾Í²»ÒªÐ¦»°Å¶¡£
·ÖÎöurl²ÎÊýÀࣺ
package com.sunshine.framework.control
{
import com.sunshin ......
ת×Ôhttp://gdljg0460.javaeye.com/blog/268848
1. Flexbox
http://flexbox.mrinalwadhwa.com/
ÕâÊÇһλÀ´×ÔÓ¡¶ÈµÄflex¿ª·¢ÕßÔÚ07Äê2Ô·ݽ¨Á¢µÄflex×é¼þ¿â£¬ÀïÃæÒ²Óв»Éٺö«Î÷¡£
2. Flexlib
http://code.google.com/p/flexlib/
ÓÉDougmccuneµÈÈ˽¨Á¢µÄflex×é¼þ¿â£¬ÆäÖÐÓв»ÉÙʵÓõÄ×é¼þ¡£
3.SpringGraph Flex Compo ......
metadata×îÏÈ¿ªÊ¼ÓÚdotnet°É£¬½Ð×öAttribute£»È»ºójavaÒ²½ôËæÆäºó£¬½Ð×öAnnotaion£»actionscriptÔò½Ð×öMetadata¡£ÆäÖÐdotnetÓëActionScriptµÄÓï·¨¸ñʽÉ϶¼ÊÇÏàËÆµÄ£¬ÈçASÖеÄ[Bindable]¡£ÔÚJavaÖÐÔòÊÇÓÃ@XXXÕâÑùµÄÓï·¨£¬Èç@override¡£²»¹ýÄ¿µÄ¶¼ÊÇÒ»¸ö£¬¸øÀà»ò·½·¨»òÊôÐÔÔö¼Ómeta data±ê¼Ç£¬´Ó¶øÊµÏÖ¶ÔÕâЩ±»±ê¼ÇµÄ´úÂë½øÐÐ ......
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
<mx:Script>
<![CDATA[
//µ¼Èë ......
Flex RadarChart À×´ïͼ
ÍÆ¼ö½â¾ö·½°¸£º
²Î¿¼ÍøÕ¾
http://lab.kapit.fr/display/radarchart/Download
Èí¼þÐí¿ÉÐÒé¿ÉÒÔʹÓÃÉçÇøÃâ·Ñ°æ
±¾:http://lab.kapit.fr/display/Store/Free+License
ÏÂÔØ×îеÄRadarChartDemo-
Community-1.X.zip
ÏÂÔØ°üÀïRadarChartDemo-Community-1.5.2Óиö
Readme_Application.pdfÀïà ......