展开全部
你好,我是昨天晚上在百度hi你的人,问题解决了,你却离线...不好意思,让你等了这么久...希望你上来,可以看到这个答案!
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.ListEvent;
import mx.controls.Alert;
[Bindable]
private var info:ArrayCollection;
private function onSelect(event:ListEvent):void{
info = new ArrayCollection();
info.addItem(event.itemRenderer.data);
}
]]>
</mx:Script>
<mx:List id="myTree" width="151" height="100%" labelField="CourseName" dataProvider="{LoginXML.AllCourse.Course}" itemClick="onSelect(event)" x="0" y="0"/>
<mx:DataGrid id="dg" width="100%" rowCount="5" verticalScrollPolicy="off" horizontalScrollPolicy="off" top="0" bottom="0" x="148" dataProvider="{info}">
<mx:columns>
<mx:DataGridColumn headerText="课程名称" dataField="CourseName"/>
<mx:DataGridColumn headerText="任课教师" dataField="CourseTeacher"/>
<mx:DataGridColumn headerText="上课时间" dataField="CourseTime"/>
<mx:DataGridColumn headerText="上课地点" dataField="CourseAddr"/>
<mx:DataGridColumn headerText="余额" dataField="CourseRemain"/>
</mx:columns>
</mx:DataGrid>
</mx:WindowedApplication>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.ListEvent;
import mx.controls.Alert;
[Bindable]
private var info:ArrayCollection;
private function onSelect(event:ListEvent):void{
info = new ArrayCollection();
info.addItem(event.itemRenderer.data);
}
]]>
</mx:Script>
<mx:List id="myTree" width="151" height="100%" labelField="CourseName" dataProvider="{LoginXML.AllCourse.Course}" itemClick="onSelect(event)" x="0" y="0"/>
<mx:DataGrid id="dg" width="100%" rowCount="5" verticalScrollPolicy="off" horizontalScrollPolicy="off" top="0" bottom="0" x="148" dataProvider="{info}">
<mx:columns>
<mx:DataGridColumn headerText="课程名称" dataField="CourseName"/>
<mx:DataGridColumn headerText="任课教师" dataField="CourseTeacher"/>
<mx:DataGridColumn headerText="上课时间" dataField="CourseTime"/>
<mx:DataGridColumn headerText="上课地点" dataField="CourseAddr"/>
<mx:DataGridColumn headerText="余额" dataField="CourseRemain"/>
</mx:columns>
</mx:DataGrid>
</mx:WindowedApplication>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询