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.
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
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>
I have attached the sample project.The problem still seems to be there.I am using FB 3 standard edition.
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.
North America
Europe, Middle East and Africa
Asia Pacific