Hello all-
  I've spent the last day now trying to get a handle of the dispatched
event from the cell renderer to the mxml file and I still cannot do
it. I've tried several of the techniques in Chapter 16 of the
"Developing Rich Clients" Flex book and still no luck. 

What boggles me is that the 'click' event w/i my cell renderer mxml
file works when I use the "cellRenderer" attribute of the mx:Datagrid
tag, but it doesn't work when I apply my mxml file to the
.cellRenderer attribute of a dynamically created datagrid. Obviously
something is getting lost b/w the parent object and my mxml file where
 the dispatched event does not get handled by the parent. I've tried
all sorts of fixes using 'parent' to no luck.

Does anyone know how this works? Thanks.

--- In [email protected], "Kevin Ewok" <[EMAIL PROTECTED]> wrote:
>
> Flexcoders -
>  
>   I have a mxml file which is basically copy and paste from the
> TimePicker.mxml file. (except for my mxml file is just a label and a
> button). When the button is clicked, the value of the label is passed
> to the Cairngorm Controller. This works completely fine when I
> implement my mxml file within the <mx:DataGrid cellRenderer=".."/>
> attribute.
> 
> However, I also have the requirement to create datagrids dynamically.
> When I create my DataGridColumn and apply my mxml file to the
> 'cellRenderer' attribute, the component appears correctly, but when I
> click the button, the method linked to my click event in the button
> never occurs. 
> 
> I'm implementing the "click" method within my mxml file that renders
> the label and button and I can't figure out what I'm doing wrong with
> the way the child is created. Thanks in advance. 
> 
> var _dgc:DataGridColumn = new DataGridColumn("newColumn");
> _dgc.cellRenderer = "com.StatusPicker";
> 
> //////// com.StatusPicker.mxml////////
> <?xml version="1.0" encoding="utf-8"?>
> <mx:HBox xmlns:mx="http://www.macromedia.com/2003/mxml";>
> <mx:Script>
> <![CDATA[
>       
> var btn : MovieClip;
> var listOwner : MovieClip;   
> var getCellIndex : Function; 
> var getDataLabel : Function;                  
> 
> function click(){
>    trace("click occured");
> }
>               
> function setValue(str:String, item:Object, selection:String):Void
> {  
>    status.text = item.STATUS;         
> }
> ]]>
> </mx:Script>
> 
> <mx:Label id="status" textAlign="center" width="20"/>
> <mx:Button id="RightArrow" icon="@Embed('/images/rightarrow.png')"
> click="click()"/>
> </mx:HBox>
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to