Flex AdvancedDataGrid表头合并

转载 2012年03月26日 20:29:44

AdvancedDataGridColumnGroup这个专用类将多列grid的表头合并在一个表头中,废话不多说了,直接上源码

<?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"
      viewSourceURL="srcview/index.html">
 
 <fx:Script>
  <![CDATA[
   import mx.collections.ArrayCollection;
   
   [Bindable]private var dpFlat:ArrayCollection = new ArrayCollection([
    {Region:"Southwest", Territory:"Arizona",
     Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000},
    {Region:"Southwest", Territory:"Arizona",
     Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}, 
    {Region:"Southwest", Territory:"Central California",
     Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000}, 
    {Region:"Southwest", Territory:"Nevada",
     Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}, 
    {Region:"Southwest", Territory:"Northern California",
     Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000},
    {Region:"Southwest", Territory:"Northern California",
     Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000}, 
    {Region:"Southwest", Territory:"Southern California",
     Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000},
    {Region:"Southwest", Territory:"Southern California",
     Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000},
    {Region:"NorthEast", Territory:"New York",
     Territory_Rep:"Jose Rodriguez", Actual:26992, Estimate:30000},
    {Region:"NorthEast", Territory:"New York",
     Territory_Rep:"lisa Sims", Actual:47885, Estimate:50000}, 
    {Region:"NorthEast", Territory:"Massachusetts",
     Territory_Rep:"kelly o'connell", Actual:172911, Estimate:20000},
    {Region:"NorthEast", Territory:"Pennsylvania",
     Territory_Rep:"John Barnes", Actual:32105, Estimate:30000},
    {Region:"MidWest", Territory:"Illinois",
     Territory_Rep:"Seth Brown", Actual:42511, Estimate:40000}
   ]);
  ]]>
 </fx:Script>
 
 <s:layout>
  <s:HorizontalLayout verticalAlign="middle" horizontalAlign="center" />
 </s:layout>
 
 <s:Panel title="AdvancedDataGrid Control"
    color="0x000000"
    borderAlpha="0.15"
    width="600">
  
  <mx:AdvancedDataGrid id="myADG"
        width="100%" height="100%"
        color="0x323232"
        dataProvider="{dpFlat}">
   
   <mx:groupedColumns>
    
    <mx:AdvancedDataGridColumn dataField="Region" />
    <mx:AdvancedDataGridColumn dataField="Territory" />
    <mx:AdvancedDataGridColumn dataField="Territory_Rep"
             headerText="Territory Rep"/>
    <mx:AdvancedDataGridColumnGroup headerText="Revenues">   
     <mx:AdvancedDataGridColumn dataField="Actual"/>
     <mx:AdvancedDataGridColumn dataField="Estimate"/>
    </mx:AdvancedDataGridColumnGroup>   
    
   </mx:groupedColumns>
   
  </mx:AdvancedDataGrid>
  
 </s:Panel>
 
   </s:Application>

本文转载于:http://www.myflexhero.com/share/flex3-mx/flex-mx-core-components/flex-mx-ui-controls/flex-mx-tree-and-datagrid-controls/117

举报

相关文章推荐

flex advanceddatagrid动态生成列

xmlns:s="library://ns.adobe.com/flex/spark"                xmlns:mx="library:/...

Flex grid 复杂表头

Flex grid 复杂表头

精选:深入理解 Docker 内部原理及网络配置

网络绝对是任何系统的核心,对于容器而言也是如此。Docker 作为目前最火的轻量级容器技术,有很多令人称道的功能,如 Docker 的镜像管理。然而,Docker的网络一直以来都比较薄弱,所以我们有必要深入了解Docker的网络知识,以满足更高的网络需求。

flex通过AdvancedDataGrid合并单元格,导出为excel表格

flex通过AdvancedDataGrid组件合并单元格,通过java端动态绑定AdvancedDataGrid的源数据,并导出AdvancedDataGrid源数据为excel表格 1.创建一个....

flex4 AdvancedDataGrid 加超链接

以上例子

flex中 AdvancedDataGrid、datagrid导出到excel

实现原理:使用as3xls这个lib,将当前页面上的AdvancedDataGrid或者Datagrid导出到excel中,效果如下     关键代码 ExportToExcel.as ...

Flex 3 AdvancedDataGrid的使用(八)

转自 http://hi.baidu.com/lz0830/blog/item/327bf5df7548841a62279862.html 我们继续来讲AdvancedDataGrid的使用。您可以...

Flex 3 AdvancedDataGrid的使用(三)

转自 http://hi.baidu.com/lz0830/blog/item/bfe3aeededec85ddb21cb165.html 设置分层数据的数据源 要配置AdvancedDataG...
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)