See the example below:-
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml ">
<mx:Script>
import mx.controls.Alert;
import mx.events.ListEvent;
private function handleDoubleClick (event:ListEvent):void
{
Alert.show ("Row double-clicked: " + event.rowIndex);
}
</mx:Script>
<mx:XMLList id="employees">
<employee>
<name>Christina Coenraets</name>
<phone>555-219-2270</phone>
<email>[EMAIL PROTECTED]</email>
<active>true</active>
</employee>
<employee>
<name>Joanne Wall</name>
<phone>555-219-2012</phone>
<email>[EMAIL PROTECTED]</email>
<active>true</active>
</employee>
<employee>
<name>Maurice Smith</name>
<phone>555-219-2012</phone>
<email> [EMAIL PROTECTED]</email>
<active>false</active>
</employee>
<employee>
<name>Mary Jones</name>
<phone>555-219-2000</phone>
<email>[EMAIL PROTECTED]</email>
<active>true</active>
</employee>
</mx:XMLList>
<mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" dataProvider="{employees}" itemDoubleClick="handleDoubleClick (event);" doubleClickEnabled="true">
<mx:columns>
<mx:Array>
<mx:DataGridColumn dataField="name" headerText="Name"/>
<mx:DataGridColumn dataField="phone" headerText="Phone"/>
<mx:DataGridColumn dataField="email" headerText="Email"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
</mx:Application>
cheers,
-abdul
On 8/24/06, mcmcbrianfarrell <[EMAIL PROTECTED]
> wrote:
As a noob to flex I am having some difficulty with what in most other environments seems
fairly trivial. How to get the row index in a grid I double-click on. It would seem that I get a
doubleclick event regardless of where in a grid I do it.
For my purposes I need the rowindex for the actual row a user doubleclicks on and all other
dbl clicks should be ignored.
Can anyone point me to some example code?
TIA!
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
![]()
SPONSORED LINKS
Software development tool Software development Software development services Home design software Software development company
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
Reply via email to

