You should use "refresh" method of the dataprovider after updating an object:
(arrivalTable.dataProvider as ArrayCollection).refresh();
So your function will look like this:
protected function addHandler(event:FlexEvent):void
{
var ImageShipId:String = Image(event.currentTarget).id;
var destination:BorderContainer = Image(event.currentTarget).owner as BorderContainer;
var destinationId:String = destination.id;
if( destinationId == "bct_HoldingArea" ){
for(var j:int = 0; j<arrivalTable.dataProvider.length; j++){
var myShip:Ship = arrivalTable.dataProvider.getItemAt(j) as Ship;
var myShipId:String = myShip.shipID.toString();
if(StringUtil.trim(myShipId) == StringUtil.trim(ImageShipId)){
myShip.checkList = true;
(arrivalTable.dataProvider as ArrayCollection).refresh();
Alert.show("The ship name : " + myShip.shipName +"\n" + "The Ship selected : " + myShip.checkList);
}
}
}
}
//EDIT The issue with the row in the middle seems to be a so called "middle row bug". I have found some info here.
To avoid this strange thing try to change your Renderer code in this way:
<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" clipAndEnableScrolling="true">
<fx:Script>
<![CDATA[
import mx.utils.ObjectUtil;
[Bindable]override public function get data():Object
{
return ObjectUtil.copy(super.data);;
}
override public function set data(value:Object):void
{
super.data = value;
}
]]>
</fx:Script>
<s:HGroup>
<s:Label text="{data.ETD}" paddingTop="8"/>
<s:CheckBox id="myCheckBox" enabled="false" selected="{data.checkList}"/>
</s:HGroup>
</s:GridItemRenderer>
//EDIT
A short explanation of this trick: I have found that data update occurs for every row except the middle one. I have tried to follow the source code of the data grid. I think the code line responsible for this action is:
renderer.data = dataItem;
in the GridLayout.as class.
This line causes data update for each row except the middle one. Why? Flex compares both sides of this expression and does nothing if they are equal. In our case they are not equal but it seems to be a real bug. Whatever... We need to wait till Flex team correct the issue.
As a temporary workaround I have changed the left side of the expression brutally by clonning the Object in the "get" function. So the comparison should now return FALSE in any case and the data property should be updated for each row.
The set function could be deleted, but it is a good place for debugging of same issues.
It is not a good approach but it is better than nothing.