If there is a filterFunction applied to your dataProvider using rowIndex will not return the correct value. This is off the top of my head but I think this should work:
myDP.getItemAtIndex(myDP.getItemIndex(event.target.data)); HTH, Ben --- In [email protected], "Gordon Smith" <[EMAIL PROTECTED]> wrote: > > Handle the DataGrid's itemRollOver event and look at event.rowIndex. > > - Gordon > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Tom Chiverton > Sent: Wednesday, February 14, 2007 4:18 AM > To: [email protected] > Subject: [flexcoders] dataProivder item under mouse in datagrid > > > > Does anyone know how I might go about finding out which item in the > dataProvder of a DataGrid is currently under the mouse (as opposed to > the > selectedItem, which may be different). > > What I am trying to achieve is the ability to right click a row, choose > 'Edit' > from the pop up menu (that bit is easy !) and then open a window with > the > item under the mouse in. > > So far, it looks like I'd have to loop through DataGrid.listItems > checking the > renderers x and y locations against the mouse's, and then compare to the > > mouse co ordinates, and use that to also figure out the row (based on a > row > being 26px high or whatever). Do all that in a Hover event handler, and > use > it to set a private variable holding the index into the dataProvider. > > What I'd really like would be a hoverIndex that functions like > selectedIndex, > but that seems to be missing - should I be going about this a different > way ? > -- > Tom Chiverton > > **************************************************** > > This email is sent for and on behalf of Halliwells LLP. > > Halliwells LLP is a limited liability partnership registered in England > and Wales under registered number OC307980 whose registered office > address is at St James's Court Brown Street Manchester M2 2JF. A list of > members is available for inspection at the registered office. Any > reference to a partner in relation to Halliwells LLP means a member of > Halliwells LLP. Regulated by the Law Society. > > CONFIDENTIALITY > > This email is intended only for the use of the addressee named above and > may be confidential or legally privileged. If you are not the addressee > you must not read it and must not use any information contained in nor > copy it nor inform any person other than Halliwells LLP or the addressee > of its existence or contents. If you have received this email in error > please delete it and notify Halliwells LLP IT Department on 0870 365 > 8008. > > For more information about Halliwells LLP visit www.halliwells.com. >

