8 Replies Latest reply: Jan 21, 2010 10:49 PM by Sameer Bhatt RSS

    Rendering issue with the navigation tree in AdvancedDataGrid

    flex2008 Community Member

      I need to display a hierarchical data in ADG.I am using HierarchicalGroupData with an xml as the dataprovider.I am facing a rendering issue when i am expanding any particular node for the first time.What happens is that there is a delay before the items in the tree are displayed(By this time the items in the other normal columns will be displayed and the tree column for the opened node will appear blank for a second).When i collapse and expand it again , it is not happening.It happens just the first time only.

       

      Any help in this matter will be appreciated.

        • 1. Re: Rendering issue with the navigation tree in AdvancedDataGrid
          paul.williams Community Member

          Perhaps the delay is caused by the creation and initialization of your renderers. Can you post the code for your grid and renderers?

          • 2. Re: Rendering issue with the navigation tree in AdvancedDataGrid
            flex2008 Community Member

            Attached my source and xml.

            From the example u can see that,only when i am using a custom item renderer this problem is happening.Otherwise it is working fine

            • 3. Re: Rendering issue with the navigation tree in AdvancedDataGrid
              flex2008 Community Member

              can anyone help me with this please?


              • 4. Re: Rendering issue with the navigation tree in AdvancedDataGrid
                flex2008 Community Member

                Obviuosly I was not using the item renderer in the right way.Now i did it with AdvancedDataGridRendererProvider.But still i am getting the same problem.

                This is the code :

                <?xml version="1.0" encoding="utf-8"?>
                <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%" xmlns:local="*">
                    <mx:XML id='dp' source="data.xml"/>
                    <mx:HierarchicalData id='hd' source="{dp.item}"/>
                    <mx:AdvancedDataGrid x="174" y="126" width="390" height="381" id="adg1" sortableColumns="false"
                        sortExpertMode="true" designViewDataType="tree" headerHeight="19" rowHeight="20"
                        dataProvider="{hd}" editable="true">
                        <mx:columns>
                            <mx:AdvancedDataGridColumn dataField="@name" headerText="Item" width="197" editable="false"/>
                            <mx:AdvancedDataGridColumn headerText="Display" id='display' dataField="@display" width="95" editable="false"/>
                            <mx:AdvancedDataGridColumn headerText="Count" dataField="@count" width="55" editable="false"/>
                        </mx:columns>
                        <mx:rendererProviders>
                            <mx:AdvancedDataGridRendererProvider column="{display}">
                                <mx:renderer>
                                    <mx:Component>
                                        <mx:HBox horizontalAlign="center">
                                        <mx:Script>
                                            <![CDATA[
                                                override public function set data(value:Object):void
                                                {
                                                        super.data = value;
                                                        cb.selected=data.@display == 'yes'?true:false;
                                                }   
                                            ]]>
                                        </mx:Script>
                                            <mx:CheckBox id='cb' />
                                        </mx:HBox>
                                    </mx:Component>
                                </mx:renderer>
                            </mx:AdvancedDataGridRendererProvider>
                        </mx:rendererProviders>
                    </mx:AdvancedDataGrid>
                    <mx:AdvancedDataGrid x="754" y="126" width="390" height="381" id="adg2" sortableColumns="false"
                        sortExpertMode="true" designViewDataType="tree" headerHeight="19" rowHeight="20"
                        dataProvider="{hd}" editable="true">
                        <mx:columns>
                            <mx:AdvancedDataGridColumn  dataField="@name" headerText="Item" width="197" editable="false"/>
                            <mx:AdvancedDataGridColumn headerText="Display" dataField="@display" width="95" editable="false"/>
                            <mx:AdvancedDataGridColumn headerText="Count" dataField="@count" width="55" editable="false"/>
                        </mx:columns>
                    </mx:AdvancedDataGrid>
                </mx:Application>

                • 5. Re: Rendering issue with the navigation tree in AdvancedDataGrid
                  flex2008 Community Member

                  I got busy with my regular work and so could not work on this.Still I am not able to figure this problem out.Any help anybody?

                  • 6. Re: Rendering issue with the navigation tree in AdvancedDataGrid
                    Sameer Bhatt Adobe Employee

                    I tried the sample and it seems to be working fine.

                    Can you post the sample application with your latest code changes?

                     

                    -Sameer

                    • 7. Re: Rendering issue with the navigation tree in AdvancedDataGrid
                      flex2008 Community Member

                      I have attached the sample project.The problem still seems to be there.I am using FB 3 standard edition.

                      • 8. Re: Rendering issue with the navigation tree in AdvancedDataGrid
                        Sameer Bhatt Adobe Employee

                        It seems to be an issue with using Containers as renderers. Please log a bug here - http://bugs.adobe.com/flex

                        I tried with a simple (very basic) renderer extending UIComponent (containing a Label) and things are working fine.

                        I've attached the renderer for your reference, you can add more things to the renderer and use it.