<mx:Model id="model"> <employees> <employee> <name>John Smith</name> <department>技术部</department> <email>john@163.com</email> </employee> <employee> <name>frostbelt</name> <department>技术部</department> <email>cszs114@sina.com</email> </employee> </employees> </mx:Model> <mx:Panel title="使用Model组件"> <mx:DataGrid dataProvider="{model.employee}"> <mx:columns> <mx:DataGridColumn dataField="name" headerText="员工名"/> <mx:DataGridColumn dataField="department" headerText="部门"/> <mx:DataGridColumn dataField="email" headerText="Email"/> </mx:columns> </mx:DataGrid> </mx:Panel> <mx:Panel title="使用Object组件" y="200"> <mx:DataGrid> <mx:dataProvider> <mx:Object name="John Smith" department="技术部" email="john@163.com"/> <mx:Object name="frostbelt" department="技术部" email="cszs114@sina.com"/> </mx:dataProvider> </mx:DataGrid> </mx:Panel> <mx:Panel title="使用XML组件" y="400"> <mx:Tree id="tree" width="218" height="397" showRoot="false" labelField="@label"> <mx:dataProvider> <mx:XML id="XMLData"> <menus> <node label="Mail"> <node label="Inbox"/> <node label="Personal Folder"> <node label="Demo"/> <node label="Personal"/> </node> <node label="Calendar"/> </node> </menus> </mx:XML> </mx:dataProvider> </mx:Tree> </mx:Panel>