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)
1 comments:
Why don't you use tileList.selectedItem?
Post a Comment