Flex 4 and the AdvancedDataGrid Error

flex4 加载module里面弹出窗口包含AdvancedDataGrid,会出错尝试实例化的函数不是构造函数。


郁闷的问题,浪费了CSDN  好几百分都没有人回答我。今天我把解决办法贴出来(参考justin),

分享下:

 

如果您使用的是Flex 4 或 Flex 3 中AdvancedDataGrid Flex,你遇到这个错误:

TypeError: Error #1007:Instantiation attempted on a non-constructor.at mx.controls::AdvancedDataGridBaseEx/getSeparator()

mx.controls::AdvancedDataGridBaseEx / getSeparator()


这是由于Flex datavisualization库不包括样式和类的引用在高级数据网格所需的默认CSS .

 

您可以使用下面的代码在您的主应用CSS代码,或到 Flex SDK/frameworks/projects/datavisualization并编译成SWF的data_management.css和在运行时加载它 - 使用模块 这是一个比较好的选择.

 

@namespace s "library://ns.adobe.com/flex/spark"; 
@namespace mx "library://ns.adobe.com/flex/halo"; 


mx|AdvancedDataGrid{
    columnDropIndicatorSkin: ClassReference("mx.skins.halo.DataGridColumnDropIndicator");
    columnResizeSkin: ClassReference("mx.skins.halo.DataGridColumnResizeSkin");
    headerColors: #FFFFFF, #E6E6E6;
    headerDragProxyStyleName: "headerDragProxyStyle";
    headerBackgroundSkin: ClassReference("mx.skins.halo.DataGridHeaderBackgroundSkin");
    headerSeparatorSkin: ClassReference("mx.skins.halo.DataGridHeaderSeparator");
    headerHorizontalSeparatorSkin: ClassReference("mx.skins.halo.AdvancedDataGridHeaderHorizontalSeparator");
    headerStyleName: "advancedDataGridStyles";
    sortArrowSkin: ClassReference("mx.skins.halo.DataGridSortArrow");
    stretchCursor: Embed(source="Assets.swf",symbol="cursorStretch");
}

mx|AdvancedDataGridSortItemRenderer{
    paddingTop: 0;
    paddingBottom: 0;
    paddingLeft: 0;
    paddingRight: 0;
    horizontalGap: 0;
    color: #0B333C;
    icon: ClassReference("mx.skins.halo.DataGridSortArrow");
}

mx|PrintAdvancedDataGrid{
    alternatingItemColors: #FFFFFF, #FFFFFF;
    borderColor: 0;
    columnResizeSkin: ClassReference("mx.skins.halo.DataGridColumnResizeSkin");
    headerColors: #FFFFFF, #FFFFFF;
    headerSeparatorSkin: ClassReference("mx.skins.halo.DataGridHeaderSeparator");
    headerStyleName: "advancedDataGridStyles";
    horizontalGridLineColor: 0;
    horizontalGridLines: true;
    sortArrowSkin: ClassReference("mx.skins.halo.DataGridSortArrow");
    stretchCursor: Embed(source="Assets.swf",symbol="cursorStretch");
    verticalGridLineColor: #000000;
}

mx|PrintOLAPDataGrid{
    alternatingItemColors: #FFFFFF, #FFFFFF;
    borderColor: 0;
    columnResizeSkin: ClassReference("mx.skins.halo.DataGridColumnResizeSkin");
    headerColors: #FFFFFF, #FFFFFF;
    headerSeparatorSkin: ClassReference("mx.skins.halo.DataGridHeaderSeparator");
    headerStyleName: "advancedDataGridStyles";
    horizontalGridLineColor: 0;
    horizontalGridLines: true;
    stretchCursor: Embed(source="Assets.swf",symbol="cursorStretch");
    verticalGridLineColor: #000000;
}


阅读更多
上一篇Flex4 模拟背景图片切换
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭