好贷网好贷款

Flex的多级联动功能

发布时间:2016-12-4 1:48:37 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"Flex的多级联动功能",主要涉及到Flex的多级联动功能方面的内容,对于Flex的多级联动功能感兴趣的同学可以参考一下。

<?xml version="1.0" encoding="utf-8"?> <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:Declarations> <!-- 将非可视元素(例如服务、值对象)放在此处 --> <fx:XML source="data.xml" format="e4x" id="xmldata" /> </fx:Declarations> <fx:Script> <![CDATA[ import mx.controls.Alert; protected function button1_clickHandler(event:MouseEvent):void { var resultPass:String = publisher.selectedItem.x.@name;//得到坐标 //xmldata.category.publisher.x.@name; //Alert.show(resultPass); } ]]> </fx:Script> <mx:Panel title="下拉框联动" width="300" height="300" horizontalAlign="center"> <mx:Form> <mx:FormItem label="house:"> <mx:ComboBox id="bookclass" dataProvider="{xmldata.category}" labelField="@name"/> </mx:FormItem> <mx:FormItem label="type:"> <mx:ComboBox id="publisher" dataProvider="{bookclass.selectedItem.publisher}" labelField="@name"/> </mx:FormItem> <mx:FormItem label="x:"> <mx:ComboBox id="bookname" dataProvider="{publisher.selectedItem.x}" labelField="@name"/> </mx:FormItem> </mx:Form> </mx:Panel> <s:Button label="ee" click="button1_clickHandler(event)"/> </s:Application> //xml数据 <?xml version="1.0" encoding="utf-8"?> <books> <category name="维义楼"> <publisher name="教学楼"> <x name="112.33"/> <y name="26.33"/> </publisher> <publisher name="教学楼1"> <x name="22112.33"/> <y name="2226.33"/> </publisher> </category> <category name="方荫楼"> <publisher name="实验室"> <x name="112.33"/> <y name="26.33"/> </publisher> </category> <category name="名达楼"> <publisher name="艺术室"> <x name="112.33"/> <y name="26.33"/> </publisher> </category> </books>

上一篇:黑马程序员--java线程创建
下一篇:《高效学习OpenGL》之 投影变换 glFrustum(),gluPerspective(),glOrtho(),gluOrtho2D()

相关文章

相关评论