zoukankan      html  css  js  c++  java
  • [Flex] PopUpButton系列 —— 将DataGrid作为弹出内容

    <?xml version="1.0" encoding="utf-8"?>
    <!--Flex中如何创建一个可以弹出DataGrid作为菜单的PopUpButton的例子 PopUpButtonDataGrid.mxml-->
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <!-- 将非可视元素(例如服务、值对象)放在此处 -->
            <fx:Array id="arr">
                <fx:Object label="《霹雳先锋》香港票房8916612" actor="Steven Chow"/>
                <fx:Object label="《捕风汉子》香港票房3149395" actor="Steven Chow"/>
                <fx:Object label="《小偷阿星》香港票房7968106 " actor="Steven Chow"/>
                <fx:Object label="笑傲江湖之东方不败(1992)" actor="Jet Li"/>
                <fx:Object label="精武英雄(1994)" actor="Jet Li"/>
                <fx:Object label="给爸爸的信(1995)" actor="Jet Li"/>
            </fx:Array>
        </fx:Declarations>
        <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            @namespace mx "library://ns.adobe.com/flex/mx";
            mx|PopUpButton {
                popUpStyleName: myCustomPopUpStyleName;
            }
            
            .myCustomPopUpStyleName {
                fontWeight: normal;
                textAlign: left;
            }
    
    
        </fx:Style>
        <mx:PopUpButton id="popUpButton" label="Click to open..." openAlways="true">
            <mx:popUp>
                <!--<mx:DataGrid dataProvider="{arr}" draggableColumns="true" rowCount="4"     width="400">
                    <mx:columns>
                        <mx:DataGridColumn dataField="label"  headerText="workers:" />
                        <mx:DataGridColumn dataField="actor"  headerText="actors:" />
                    </mx:columns>
                </mx:DataGrid>-->
                
                <s:DataGrid dataProvider="{new ArrayCollection(arr)}"  height="100" width="400" >
                    <s:columns>
                        <s:ArrayList>
                            <s:GridColumn dataField="label" headerText="workers:"/>
                            <s:GridColumn dataField="actor" headerText="actors:"/>
                        </s:ArrayList>
                    </s:columns>
                </s:DataGrid>
            </mx:popUp>
        </mx:PopUpButton>
    </s:Application>
  • 相关阅读:
    需要返回对象时候,不要以引用形式返回
    成对使用new和delete,传值传引用
    赋值重载的约定(1)
    oracle操作字符串:拼接、替换、截取、查找
    Oracle CASE WHEN 用法介绍
    oracle中如何对字符串进行去除空格的方法
    日期显示
    Oracle Cursor用法总结
    每天一个linux命令(26):用SecureCRT来上传和下载文件
    每天一个linux命令(25):linux文件属性详解
  • 原文地址:https://www.cnblogs.com/frost-yen/p/5195287.html
Copyright © 2011-2022 走看看