数据表格控件 DataGridControl

数据表格控件

书154页

<?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:XMLList id="books">
            <book>
                <name>AJAX经典案例开发大全</name>
                <price>52.80</price>
                <ISBN>9787302154105</ISBN>
            </book>
            <book>
                <name>PHP网络编程从入门到精通</name>
                <price>59.80</price>
                <ISBN>9787302154129</ISBN>
            </book>
            <book>
                <name>Dreamwever网页设计与制作完全手册</name>
                <price>59.80</price>
                <ISBN>9787302154112</ISBN>
            </book>
            <book>
                <name>JSP网络编程从入门到精通</name>
                <price>62.00</price>
                <ISBN>9787302147107</ISBN>
            </book>
        </fx:XMLList>
    </fx:Declarations>
    <!-- 数据表格控件 -->
    
    <mx:Panel title="数据表格实例" height="50%" width="50%" paddingTop="10" paddingLeft="10" paddingRight="10">
        <mx:DataGrid id="dg" width="100%" height="50%" rowCount="5" dataProvider="{books}">
            <mx:columns>
                <mx:DataGridColumn dataField="name" headerText="书名"/>
                <mx:DataGridColumn dataField="price" headerText="价格"/>
                <mx:DataGridColumn dataField="ISBN" headerText="ISBN"/>
            </mx:columns>
        </mx:DataGrid>
        <mx:Form width="100%" height="100%">
            <mx:FormItem label="书名">
                <mx:Label text="{dg.selectedItem.name}"/>
            </mx:FormItem>
            <mx:FormItem label="价格">
                <mx:Label text="{dg.selectedItem.price}"/>
            </mx:FormItem>
            <mx:FormItem label="ISBN">
                <mx:Label text="{dg.selectedItem.ISBN}"/>
            </mx:FormItem>
        </mx:Form>
    </mx:Panel>
</s:Application>

 

转载于:https://www.cnblogs.com/yingyigongzi/p/10683241.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值