mx:DataGrid与s:DataGrid的写法

来源:互联网 发布:mysql数据库zip下载 编辑:程序博客网 时间:2024/06/06 03:45

Flex4.5中,mx:DataGrid与s:DataGrid的写法是不一样的

<?xml version="1.0" encoding="utf-8"?><s:Application ... >        <fx:Declarations>        <!-- 将非可视元素(例如服务、值对象)放在此处 -->        <s:ArrayList id="shiZhengData">            <fx:Object name="唐曾" phone="13800138000" zhizefawei="西至大黑天,东至盘古" zhineng="打家劫舍" />            ...        </s:ArrayList>    </fx:Declarations>        <!-- mx:DataGrid -->    <mx:DataGrid id="ShiZhengDG" dataProvider="{shiZhengData}">        <mx:columns>            <mx:DataGridColumn dataField="name" headerText="姓名" width="80" />            <mx:DataGridColumn dataField="phone" headerText="电话" width="120" />                                    <mx:DataGridColumn dataField="zhineng" headerText="职能" />            <mx:DataGridColumn dataField="zhizefawei" headerText="职责范围" />        </mx:columns>    </mx:DataGrid>      <!-- s:DataGrid -->    <s:DataGrid id="spark_ShiZhengDG" dataProvider="{shiZhengData}">        <s:columns>            <s:ArrayList>                <s:GridColumn dataField="name" headerText="姓名" width="80"  />                <s:GridColumn dataField="phone" headerText="电话" width="120" />                                        <s:GridColumn dataField="zhineng" headerText="职能" />                <s:GridColumn dataField="zhizefawei" headerText="职责范围" />            </s:ArrayList>        </s:columns>    </s:DataGrid>    </s:Application>

运行结果分别如下:

mx:DataGrid

s:DataGrid

 

注:上一篇关于mx:DataGrid样式CSS的应用,对于s:DataGrid却没有什么效果.

0 0
原创粉丝点击