OldHawk

菜地一块,欢迎拍砖
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Displaying a Tree control as a pop up for a Flex PopUpButton control

Posted on 2008-02-28 17:00  OldHawk  阅读(773)  评论(0编辑  收藏  举报
The following example shows how you can use a Tree control as a PopUpButton control’s pop up in Flex
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/02/26/displaying-a-tree-control-as-a-pop-up-for-a-flex-popupbutton-control/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white">

    
<mx:Style>
        Tree {
            textAlign: left;
            fontWeight: normal;
        }
    
</mx:Style>

    
<mx:XML id="mlb" source="mlb.xml" />

    
<mx:ApplicationControlBar dock="true">
        
<mx:PopUpButton label="Please select a team">
            
<mx:popUp>
                
<mx:Tree id="tree"
                        dataProvider
="{mlb}"
                        labelField
="@label"
                        showRoot
="false"
                        width
="200"
                        rowCount
="8" />
            
</mx:popUp>
        
</mx:PopUpButton>
    
</mx:ApplicationControlBar>

</mx:Application>