Flex progressbar in datagrid

Embed progressbar in datagrid 
See the code below.

The key point is <mx:itemRednderer> ... .This seqment can embed component into datagrid.

fetch data to set progressbar 
The key point is this.data["progress"]. The this.data["progress"] is the value getted from dataprovider.

trigger to update progressbar 
This key point is updateComplete handler which is called when dataprovider is refreshed. So we

can update progressbar in updateComplete callback function.

 <mx:AdvancedDataGridColumn id="progressshow" width="300" datafield="progress"
            headerText="进度">
   <mx:itemRenderer>
    <fx:Component>
     <mx:HBox creationComplete="hBox1_creationCompleteHandler(event)"
        updateComplete="hBox1_updateCompleteHandler(event)">
      <fx:Script>
       <![CDATA[
        import mx.events.FlexEvent;
        
        protected function hBox1_updateCompleteHandler(event:FlexEvent):void
        {
         if(this.data != null)
         {
          trace(this.data["progress"]);
          pd.setProgress(this.data["progress"],100);
          pd.label = "已完成" + pd.percentComplete + "%";
         }
         
        }
        
        protected function hBox1_creationCompleteHandler(event:FlexEvent):void
        {
         pd.setProgress(0,100);
         pd.label = "已完成" + pd.percentComplete + "%";
         
        }
        
       ]]>
      </fx:Script>
      <mx:ProgressBar id="pd" width="280" maximum="100" minimum="0" mode="manual">
      </mx:ProgressBar> 
     </mx:HBox>
    </fx:Component>
   </mx:itemRenderer>
   </mx:AdvancedDataGridColumn>

相关文章

一:display:flex布局display:flex是一种布局方式。它即可以...
1. flex设置元素垂直居中对齐在之前的一篇文章中记载过如何...
移动端开发知识点pc端软件和移动端apppc端软件是什么,有哪些...
最近挺忙的,准备考试,还有其他的事,没时间研究东西,快周...
display:flex;把容器设置为弹性盒模型(设置为弹性盒模型之后...
我在网页上运行了一个Flex应用程序,我想使用Command←组合键...