开发者

How to access ArrayCollection Data

I know this one might be easy but I couldn't figure out.

I have a List control that retrieve multiply data from Mysql. When a use clicks the data on List, The datagrid will display the data and the product image will show.

I can see the multiply data shown in my dataGrid, but I don't know how to get the 开发者_C百科individual data shown. I am not sure if I explain the questoin well. Please see the code below and thanks for any reply.

<s:List id="compList"
width="250"
height="350"
creationComplete="compList_creationCompleteHandler(event)"
itemRenderer="itemRenderer.compListItemRenderer"
change="compList_changeHandler(event)"  //when a user select a row, the datagrid will display the data.
>
<s:AsyncListView list="{compinfoResult.lastResult}"/>

</s:List>




<mx:DataGrid id="dataGrid" dataProvider="{compDetailinfoResult.lastResult}">      //The dataGrid display the data fine
<mx:columns>
<mx:DataGridColumn dataField="user" headerText="User"/>
<mx:DataGridColumn dataField="brand" headerText="Brand"/>
<mx:DataGridColumn dataField="compModel" headerText="Model"/>
<mx:DataGridColumn dataField="picture" headerText="Product Picture"/>
</mx:columns>
</mx:DataGrid>


<mx:Image source="??????" />   // I want to display productPicture here too but not sure what to add here.....


Try Something like this:

<mx:Image source="{dataGrid.selectedItem.sourcelocation}" />

It would be easier to be more specific if you had a running sample and/or an explanation of the value objects that make up your list. Your approach seems odd to me; as it appears you are using a DataGrid to display a single item. Is that correct? DataGrids are good for displaying multiple, similar, items in a table like format; I'm not sure if I'd use it for a single item.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜