Hi Artur.
In your itemRenderer, you can listen to the DataGrid for events. This help doc example shows one way that you can get the row and column index of the cell that was clicked. You could also listen for itemEditBegin, itemEditBeginning and itemFocusIn. You'll probably have to use something like "parentDocument.myDataGrid" when creating your eventListener.
-TH
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.events.ListEvent;
private function itemClickEvent(event:ListEvent):void {
clickColumn.text=String(event.columnIndex);
clickRow.text=String(event.rowIndex);
eventType.text=event.type;
}
]]>
</mx:Script>
<mx:DataGrid id="myGrid" width="350" height="150"
itemClick="itemClickEvent(event);">
<mx:ArrayCollection>
<mx:Object Artist="Pavement" Price="11.99"
Album="Slanted and Enchanted" />
<mx:Object Artist="Pavement" Album="Brighten the Corners"
Price="11.99" />
</mx:ArrayCollection>
</mx:DataGrid>
<mx:TextArea id="clickColumn" />
<mx:TextArea id="clickRow" />
<mx:TextArea id="eventType" />
</mx:Application>
--- In [email protected], "Artur Kordowski" <[EMAIL PROTECTED]> wrote:
>
> In Flex 1.5 there was a way to get the reference of a DataGrid cell by using
> listOwner.rows[1].cells[1]. The same I try to do in Flex 2. I've tried to
> get the reference in my itemRenderer by using
> listData.owner.indexToItemRenderer(1). But in a itemRenderer the owner
> variable haven't any indexToItemRenderer() function. I need the reference to
> disable some controls if an other cell is clicked. Have anyone an idea how I
> can do it or in wich way I got the reference of the cell?
>
> Any help will be appreciate.
>
> Artur
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
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.
__,_._,___

