2013-09-24 43 views

回答

2

一種方式來做到這一點是通過擴展默認的itemRenderer和重寫集數據的方法:

override public function set data(value:Object):void { 
      super.data = value; 
      // retrieve the value of the list-based control's new public property 
      var minAge:Number = (listData.owner as MyList).minAge; 
      if (data.age < minAge) { 
       listLabel.setStyle("color",0xFF0000); 
      } else { 
       listLabel.setStyle("color",0x000000); 
      } 
     } 

下面是一個很好的例子的鏈接:

http://blog.flexdevelopers.com/2009/06/flex-examples-item-renderers-in.html