If you implement IDropInListItemRenderer, the listData property has an
owner property that points to the TileList.

 

You can also just assume that parent.parent is the TileList.

 

However, in theory, all the data you need is in the data property so you
shouldn't need index.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of tosadavemgr
Sent: Thursday, March 22, 2007 9:48 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Finding index of thumbnail in itemRenderer (and
passing it along to popUpManager

 

I have a TileList that uses an itemRenderer to display thumbnails of
products. When the user clicks the thumbnail, it launches a product
detail window component as a model popup. I need to be able to display
the detail information for the product that was clicked in the detail
window.
So I'm after the selectedIndex (or whatever the proper syntax is), so I
can use that index number in the popup.

My tilelist:
<mx:TileList id="tl" height="100%" width="190"
dataProvider="{myProduct}" itemRenderer="thumbnail" columnCount="2"
columnWidth="85" dragEnabled="true" click="showDetail()" ></mx:TileList>

My Thumbnail Component that the itemRenderer references:
<?xml version="1.0"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " 
horizontalAlign="center"
verticalGap="0" borderStyle="none" paddingLeft="0"
paddingRight="0">
<mx:Image id="img" width="82" height="62"
source="{data.thumbnail}" toolTip="{data.code} - {data.name}" />
</mx:VBox>

I've tried referencing the data.selectedIndex from the thumbnail
component. But that doesn't work.

Any help appreciated. This seems to be a somewhat common task, so I
hoping a relatively easy answer exists.

Dave

 

Reply via email to