0
我知道這一個可能很容易,但我無法弄清楚。如何訪問ArrayCollection數據
我有一個列表控件,從Mysql檢索乘法數據。當用戶點擊列表中的數據時,數據網格將顯示數據並顯示產品圖像。
我可以看到我的dataGrid中顯示的乘法數據,但我不知道如何獲取顯示的單個數據。我不確定我是否很好地解釋了這個問題。請參閱下面的代碼並感謝您的回覆。
<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.....
感謝您的回覆。我想我沒有很好地解釋這個問題。我希望用戶單擊List控件數據並在DataGrid和圖像控件上顯示產品詳細信息。我確實有多個項目顯示在我的dataGrid中(請參閱上面的代碼)。您的代碼適用於單擊數據網格數據而不是List的用戶。我欣賞幫助。 – FlyingCat 2010-06-24 18:59:31
沒關係。我想我現在明白了。我的問題並不清楚。 +1併爲您接受答案。 – FlyingCat 2010-06-24 19:00:58
我希望我能幫上忙。我不明白這對多個項目意味着什麼。順便說一句,我的代碼沒有什麼可做的w /點擊DataGrid。點擊只是一種選擇DataGrid上的項目的方法[或List]感謝代表,但。 – JeffryHouser 2010-06-24 20:10:55