Hi,
I know this problem, happened to me once.
This is a known issue that won't be fixed by Adobe.
It usually happens when you try to scroll - the data is presented in
a wrong way.
But it has a solution.
Add an event listener for FlexEvent.DataChange in your itemRenderer.
In the listener function do your code again.
for instance if i have an inline item renderer that presents a
property named currentConcurrentCalls, i need to add an event
listener for the dataChange event and render it again there :
<mx:itemRenderer>
<mx:Component>
<mx:HBox width="100%" creationComplete="doInit()">
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
import mx.resources.ResourceBundle;
[ResourceBundle("hostlynx")]
private static const _rb:ResourceBundle;
[Bindable]
private var strMaxConcurrentCalls:String;
private function doInit():void{
if(data!=null && data.entityObject
["currentConcurrentCalls"] != null){
strMaxConcurrentCalls =
data.entityObject.currentConcurrentCalls;
}
addEventListener(FlexEvent.DATA_CHANGE,dataChange);
}
private function dataChange(event:FlexEvent):void{
if(data!=null && data.entityObject
["currentConcurrentCalls"] != null){
strMaxConcurrentCalls =
data.entityObject.currentConcurrentCalls;
}
}
]]>
</mx:Script>
<mx:Text id="txtCurrentCalls" text="{strMaxConcurrentCalls}"
styleName="dataGridText"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
Hope it helps,
Yossi
--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Which version? Can you post a small test case?
>
> ________________________________
>
> From: [email protected]
[mailto:[EMAIL PROTECTED] On
> Behalf Of danny_yoo88
> Sent: Tuesday, November 27, 2007 6:03 PM
> To: [email protected]
> Subject: [flexcoders] Help! Datagrid bug?
>
>
>
> Hi,
>
> I have a DataGrid with an inline itemRenderer.
>
> Originally the DataGrid was using an Array as a data source.
> Everything was fine.
>
> Then I changed my datasource to an object containing sub-objects
and I
> revised my datagrid accordingly.
>
> I use DateChooser to fire off an event when a date is selected. The
> DataGrid listens for the event and event-code adds the date to the
> data source.
>
> Everything works BUT...
>
> When I enter dates in newest to older sequence, the DataGrid
renders
> TWO rows for the older date. i.e:
>
> Row 1: November 26, 2007
> Row 1: November 26, 2007
> Row 2: November 27, 2007
>
> When I inspect the data source and the
DataGrid.dataProvider.source I
> only see two entries.
>
> When I hover over November 26, 2007, only the last instance
responds
> by highlighting the row blue. I can't do anything to the first row.
>
> The only way to make things right is to click on a header-column to
> sort the grid or add another date. Then the duplicate magically
> disappears.
>
> I can't seem to do anything to the DataGrid (invalidateList, etc)
to
> force update the grid.
>
> Any ideas?
>
> Thanks,
>
> Danny
>