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 teamDisplaying a Tree control as a pop up for a Flex PopUpButton control (转载)">
            
<mx:popUp>
                
<mx:Tree id="tree"
                        dataProvider
="{mlb}"
                        labelField
="@label"
                        showRoot
="false"
                        width
="200"
                        rowCount
="8" />
            
</mx:popUp>
        
</mx:PopUpButton>
    
</mx:ApplicationControlBar>

</mx:Application>

相关文章:

  • 2021-08-09
  • 2021-10-25
  • 2021-11-15
  • 2021-10-21
  • 2022-01-23
  • 2021-09-29
  • 2022-01-06
  • 2021-11-01
猜你喜欢
  • 2021-06-15
  • 2021-11-10
  • 2021-06-07
  • 2021-09-09
  • 2021-05-30
  • 2021-09-26
  • 2022-01-14
相关资源
相似解决方案