0

これは簡単かもしれませんが、わかりませんでした。

Mysql から乗算データを取得する List コントロールがあります。ユーザーがリストのデータをクリックすると、データグリッドにデータが表示され、製品の画像が表示されます。

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.....
4

1 に答える 1

2

次のようなことを試してください:

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

実行中のサンプルや、リストを構成する値オブジェクトの説明があれば、より具体的にするのが簡単になります。あなたのアプローチは私には奇妙に思えます。表示されているように、DataGrid を使用して単一のアイテムを表示しています。あれは正しいですか?DataGrid は、複数の類似したアイテムをテーブルのような形式で表示するのに適しています。単品で使うか迷っています。

于 2010-06-24T18:54:07.287 に答える