I am listing an Arraycollection in a datagrid using flex and inside the datagrid I have a button to delete a row, after that I re-assign the same Arraycollection again by fetching an array from a java service
My Code:
<mx:DataGrid width="100%" height="100%" dataProvider="{xxx}" >
<mx:columns>
<mx:DataGridColumn dataField="name" headerText="Name"/>
<mx:DataGridColumn dataField="status" headerText="Status"/>
<mx:DataGridColumn dataField="path" headerTeUxt="Actions" wordWrap="true" minWidth="120">
<mx:itemRenderer>
<mx:Component>
<mx:Script>
<![CDATA[
protected function deliteminlist(event:MouseEvent):void
{
//delete a value in arrayCollection
//Fetch the array collection from java Service
//assigning to variable dataprovider variable
_view.xxx = null;
_view.xxx = temp;
//xxx is the arraycollection and dataprovider for the datagrid
}
]]>
</mx:Script>
<mx:Image source="@Embed(source='/assets/images/clone.png')" click="deliteminlist(event)" />
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
This is throwing an error (An internal error has occurred - Error #1010. ) and data is not refreshing in the datagrid.