`
可爱の小猪
  • 浏览: 104869 次
  • 性别: Icon_minigender_1
  • 来自: 南充
社区版块
存档分类
最新评论

flex读取xml实现三级联动

阅读更多

数据源student_grade.xml

<?xml version="1.0" encoding="utf-8"?>
<students>
<student name="jimmy">
  <grade subject="math">100</grade>
  <grade subject="history">120</grade>
</student>

<student name="lucy">
  <grade subject="arts">130</grade>
  <grade subject="biology">140</grade>
</student>
</students>
</countries>

flex 页面

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">
  
    <mx:XML id="dp" source="student_grade.xml" format="e4x" />
  
    <mx:Form>
        <mx:FormItem label="Student:">
            <mx:ComboBox id="student" dataProvider="{dp.student}" labelField="@name" />
        </mx:FormItem>
        <mx:FormItem label="Grade:">
            <mx:ComboBox id="grade" dataProvider="{student.selectedItem.grade}" />
        </mx:FormItem>
    </mx:Form>
  
</mx:Application>

分享到:
评论
Global site tag (gtag.js) - Google Analytics