Flex datagrid double click

The flex datagrid supports an event handler called itemDoubleClick , however one little gotcha is you also need to set doubleClickEnabled to true in order for this event to be properly fired.

<mx :Script>
< ![CDATA[
protected var dp:ArrayCollection = new ArrayCollection();
protected function trackGrid_itemDoubleClickHandler(event:ListEvent):void {
var data:Object = dp.getItemAt(event.currentTarget.selectedIndex);
// TODO: what you want to do with the data here
}
]]>
</mx>

<mx :DataGrid dataProvider="{dp}" doubleClickEnabled="true" itemDoubleClick="myGrid_itemDoubleClickHandler(event)" id="myGrid">

</mx>

About stevestmartin

A Web Application Developer based out of Tampa, FL. Currently employed as a Sr. Developer doing PHP / MySQL and UI development at TraderPlanet a social network for traders and investors. Current focuses are Ruby, Rails, BDD and Audio Production
This entry was posted in Flex and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>