Tuesday, July 28, 2009

Getting Currently Selected item from Flex Tilelist Component

To day for some time i have struck with accessing the selected item in the tilelist component after trying out many methods.

fianlly i got the access to selected component of list by using the itemclick event of tilelist component.

In itemclick event we can get access to the selected item of the tile list .

By event.currentTarget will can get the currently clicked component of the particular tilelist component,

by using event.currentTarget.selecteditem we can get the selected item and

event.currentTarget.selectedindex will return the selected items index.

MXML Code:

<mx:TileList dataProvider="{chartAryCol}" id="chart"
itemClick="chartTileClick(event);" />

Action Script Code:
/*Item click event function */

private function chartTileClick(event:ListEvent):void
trace("Tile-target -->"+event.currentTarget.selectedItem);


event.currentTarget.selectedIndex give the index of the item clicked(selected)

Bookmark and Share


Anonymous,  September 3, 2009 at 7:06 PM  

Why don't you use tileList.selectedItem?

Post a Comment

Tech World

Label Cloud

Must Buy

  © Blogger templates by updated with tips

Back to TOP