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
Ïà¹ØÎĵµ£º
Flex×îÇ¿´óµÄÌØÐÔÖ®Ò»¾ÍÊÇËüÔÚ±êÇ©ºÍ
ActionScriptÀàÖ®¼ä´´½¨ÁËÒ»¸ö¼òµ¥µÄÓ³Éä¡£ÕâÊÇÒ»¸ö¼òµ¥µÄ¸ÅÄµ«ÊÇÎÒ¶à´Î·¢ÏÖ²»¶®FlexµÄÈ˶ÔÕâµãÊÇÈçºÎ¹¤×÷µÄ»òÕß‘ËüΪʲôÓÐÓÃ’Àí½â
ÆðÀ´ÓÐÀ§ÄÑ¡£
¶ÔÄÇЩѧϰFlexµÄÐÂÊÖ£¬ÕâÀïÓÐһЩ¹æÔòÒÔ¼°
һЩ¼òµ¥µÄÀý×ÓÈÃÄãÃÇÒÔ´Ë¿ªÊ¼Ñ§Ï°Õâ¸öÌØÐÔ¡£
Àý×Ó 1 —— ......
È¥ÄêÒò¼¼ÊõÐèÒª£¬Ñо¿Á˶Îʱ¼äflex3£¬Ê±¸ôÒ»Ä꣬±ÉÈ˸оõÍüµÄ²î²»¶àÁË£¬°¦£¬É¶¼ÇÐÔ°¡£¬ÏÖÔÚ£¬Adobe¹«Ë¾µÄflex°æ±¾ÒѾµ½4ÁË£¬²»¹ý»¹ÔÚbeta½×¶Î£¬ÏÖÔÚÊÇbeta2£¬´Óflex3 µ½flex4 ×îÖ±¹ÛµÄ±ä»¯¾ÍÊÇ»ùÓÚEclipseµÄIDE Flex Builder ¸üÃûΪ Flash Builder£¬
ÆäÖÐFlex 4 Ö§³ÖµÄÐÂÌØÐÔÓÐ:
1. Package explorer(°ü×ÊÔ´¹ÜÀíÆ÷)
ÖÕÓ ......
ÏÂÃæÊÇһЩ³£¼ûµÄ±àÒëÆ÷²ÎÊý£º
1£¬¡¾verbose-stacktraces¡¿
Ö¸¶¨SWFÔÚÔËÐÐʱÒì³£ÐÅÏ¢Öаüº¬ÐкźÍÎļþÃû£¬Õ⽫ʹ²úÉúµÄSWFÎļþ¸ü´óЩ£¬´ø
verbose-stacktracesµÄSWF»¹ÊǺ͵÷ÊÔ°æ±¾µÄSWFÓÐÇø±ðµÄ¡£
2£¬¡¾source-path path-element¡¿
Ìí¼ÓÆäËûÔ´´úÂëĿ¼»òÎļþ£¬¿ÉÒÔʹÓÃͨÅä·ûÀ´Ìí¼ÓĿ¼ÖÐËùÓÐÎļþ»ò×ÓĿ¼£¬Ò²¿ÉÊ ......
ÔÚFlexÓ¦ÓÃÖг£³£ÐèÒªÒÔÒ»¶¨µÄ¸ñʽÀ´ÏÔʾʱ¼ä£¬ÒÔÏÂÊÇÒ»ÖÖ×ö·¨¡£
Ê×ÏÈ´´½¨Ò»¸öDateFormatter ¿Ø¼þ
<mx:DateFormatter id="df" formatString="YYYY-MM-DD JJ:NN:SS"/>
formatString="YYYY-MM-DD JJ:NN:SS"Ö¸¶¨ÁËʱ¼äµÄ¸ñʽΪ2009-6-20 19:02:27£¬ÕâÀï¿ÉÒÔÉèÖóÉ×Ô¼ºÐèÒªµÄ¸ñʽ¡£
È»ºóд¸öº¯Êý
......
1. ¿ª·¢¹¤¾ß £º MyEclipse5.5, FlexBuilder3, Tomcat6.
2. ¿ª·¢¹ý³Ì £º
µÚÒ»²½ £º ÏÂÔØBlazeDS, µØÖ·£ºhttp://opensource.adobe.com/wiki/display/blazeds/Release+Builds, ½âѹËõ¡£
µÚ¶þ²½ £º ÔÚMyEclipseÖÐн¨WEB¹¤³Ì£¬µ¼ÈëÒÀÀµ¿â£º
  ......