加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flex progressbar in datagrid

发布时间:2020-12-15 04:45:09 所属栏目:百科 来源:网络整理
导读: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 v
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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读