[Flex] PopUpButton系列 —— 将DataGrid作为弹出内容
2016-02-17 14:45
579 查看
<?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>
相关文章推荐
- linux下vi命令大全
- [转帖]移植mplayer到迅为itop4412开发板
- [Flex] PopUpButton系列——CornerRadius的运用
- Tomcat学习—Tomcat的端口修改和编码方式修改
- centos源码下载地址
- 深度解析Linux根文件系统的挂载过程
- 我的架构经验小结(二)-- 关于三层架构
- OpenCV---图片生成视频
- Linux的一个包资源库
- 关于eclipse部署项目后,在tomcat中的webapps文件夹下没有项目
- linux解压
- opencv--HSV
- I.mx6s上移植wm8960驱动(基于linux3.0.101版本)
- div浮动到img上面
- bash检查文件格式
- 我的架构经验小结(一)-- 常用的架构模型
- Linux下ps命令详解
- Linux利用list_head结构实现双向链表
- CSS架构
- 简单的shell实验(db2数据库)