加载多个advanceddatagrids时出现StackOverFlowError

时间:2012-11-29 06:31:36

标签: flex

我在主数据网格右侧的选项卡式导航器(每个选项卡一个)上有两个自定义高级数据网格,列出了供用户选择的选项。当用户单击主数据网格上的行项目时,选项卡式导航器中的高级数据网格将加载适当的信息。问题是,在我最初加载用户做出的第一个选择之后,当用户尝试进行第二次选择时,它将冻结。但是,如果用户在进行第二次选择之前决定切换选项卡(查看选项卡1和2),一切都很顺利。如果在下一次选择之前查看了仅选项卡1 ...崩溃..

advanceddatagrid的源代码可以在这里找到: http://code.google.com/p/advanceddatagrid/source/browse/trunk/mergeableDataGrid/src/AdvancedDataGrid/AdvancedDataGrid.mxml?r=3

我已经修改了网格如何循环遍历xml,虽然可以在下面的代码片段中看到

        public function createGrid(xml:XML):void
        {
            // create columns 
            var columns:ArrayList = new ArrayList();  

            var rows:ArrayCollection = new ArrayCollection(); 

            for each (var column:XML in xml.Columns.Column)
            {
                var col:AdvancedDataGridColumn = new AdvancedDataGridColumn();

                col.dataField = column.DataField.valueOf().toString(); 
                col.headerText = column.Name.valueOf().toString();
                col.dataTipField = column.Tooltip.valueOf().toString();
                col.showDataTips = true;

                columns.addItem(col);
            }

            this.dataProvider = xml.Rows.Row;

            this.groupedColumns = columns.toArray();
        }

这是我的选项卡式导航器代码

    <mx:TabNavigator id="tabNavigator"  width="100%" height="100%">         
        <s:VGroup width="100%"
                 label="Financial">
            <s:HGroup height="100%"
                      width="100%"
                      gap="0">
                <dataGrid:AdvancedDataGrid id="fundingGrid"
                                           itemEditBeginning="fundingGrid_itemEditBeginningHandler(event)"
                                           itemEditEnd="fundingGrid_itemEditEndHandler(event)"
                                           width="100%"
                                           height="100%"/>          

            </s:HGroup>
        </s:VGroup>
        <s:VGroup width="100%"
                 label="Quarterly Breakdown">
            <s:HGroup height="100%"
                     width="100%">
                <dataGrid:AdvancedDataGrid id="quarterlyBreakdownGrid"
                                           width="85%"
                                           height="100%"
                                           itemEditBeginning="quarterlyBreakdownGrid_itemEditBeginningHandler(event)"
                                           itemEditEnd="quarterlyBreakdownGrid_itemEditEndHandler(event)"/>     
                <s:Button id="btnSaveQuarterlyBreakdown"
                          label="Submit"
                          toolTip="Click to save program's quarterly funding."
                          click="btnSaveQuarterlyBreakdown_clickHandler(event)"/>

            </s:HGroup>
        </s:VGroup>
    </mx:TabNavigator>

当用户从网格中选择一个行项目时,高级数据网格会以列名和行的形式发送xml。此createGrid方法位于第一个代码段中。

this.fundingGrid.createGrid(fundingXML);
this.quarterlyBreakdownGrid.createGrid(bdXML);

错误消息

  

错误:错误#1023:发生堆栈溢出。       at mx.styles :: StyleManager $ / getStyleManager()       at mx.styles :: StyleProtoChain $ / getStyleManager()       at mx.styles :: StyleProtoChain $ / getTypeHierarchy()       at mx.styles :: StyleProtoChain $ / matchesCSSType()       在mx.core :: UIComponent / matchesCSSType()       at mx.styles :: CSSSelector / matchesStyleClient()       在mx.styles :: CSSStyleDeclaration / matchesStyleClient()       at mx.styles :: StyleProtoChain $ / matchStyleDeclarations()       at mx.styles :: StyleProtoChain $ / getClassStyleDeclarations()       在mx.core :: UIComponent / getClassStyleDeclarations()       at mx.styles :: StyleProtoChain $ / getMatchingStyleDeclarations()       at mx.styles :: StyleProtoChain $ / initProtoChain()       在mx.core :: UIComponent / http://www.adobe.com/2006/flex/mx/internal :: initProtoChain()       在mx.core :: UIComponent / regenerateStyleCache()       在mx.core :: UIComponent / http://www.adobe.com/2006/flex/mx/internal :: addingChild()       在mx.core :: UIComponent / addChild()       at mx.controls :: AdvancedDataGrid / addRendererToContentArea()[E:\ dev \ 4.x \ frameworks \ projects \ datavisualization \ src \ mx \ controls \ AdvancedDataGrid.as:2125]       在mx.controls :: AdvancedDataGrid / createHeaderItems()[E:\ dev \ 4.x \ frameworks \ projects \ datavisualization \ src \ mx \ controls \ AdvancedDataGrid.as:5968]       在mx.controls :: AdvancedDataGrid / createHeaders()[E:\ dev \ 4.x \ frameworks \ projects \ datavisualization \ src \ mx \ controls \ AdvancedDataGrid.as:2257]       at mx.controls.advancedDataGridClasses :: AdvancedDataGridBase / makeRowsAndColumns()[E:\ dev \ 4.x \ frameworks \ projects \ datavisualization \ src \ mx \ controls \ advancedDataGridClasses \ AdvancedDataGridBase.as:822]       at mx.controls :: AdvancedDataGridBaseEx / makeRowsAndColumns()[E:\ dev \ 4.x \ frameworks \ projects \ datavisualization \ src \ mx \ controls \ AdvancedDataGridBaseEx.as:2213]       在mx.controls :: AdvancedDataGrid / makeRowsAndColumns()[E:\ dev \ 4.x \ frameworks \ projects \ datavisualization \ src \ mx \ controls \ AdvancedDataGrid.as:1999]       at mx.controls.listClasses :: AdvancedListBase / makeRowsAndColumnsWithExtraRows()[E:\ dev \ 4.x \ frameworks \ projects \ datavisualization \ src \ mx \ controls \ listClasses \ AdvancedListBase.as:4002]       at mx.controls.listClasses :: AdvancedListBase / updateDisplayList()[E:\ dev \ 4.x \ frameworks \ projects \ datavisualization \ src \ mx \ controls \ listClasses \ AdvancedListBase.as:3574]       在mx.controls :: AdvancedDataGridBaseEx / updateDisplayList()[E:\ dev \ 4.x \ frameworks \ projects \ datavisualization \ src \ mx \ controls \ AdvancedDataGridBaseEx.as:2016]       at mx.controls :: AdvancedDataGrid / updateDisplayList()[E:\ dev \ 4.x \ frameworks \ projects \ datavisualization \ src \ mx \ controls \ AdvancedDataGrid.as:2899]       在mx.core :: ScrollControlBase / setScrollBarProperties()

有什么想法吗?我知道这可能看起来令人困惑......如果有必要,愿意详细说明。

0 个答案:

没有答案