Hi McRain,

You can do it by calling ...

                                                           <mx:Script>
 
<![CDATA[
 
private function myItemFunction():void{
 
outerDocument.myPublicFunction(data);
                                                                                
 }
                                                                         ]]
>
                                                            </
mx:Script>


REMEMBER: Function you want to call must be decalred public. You can
not call any other scoped functions from item renderer. Reason being,
we define define itemrenderer as a component and that makes it a
separate document differring from the one in which we have grid. So
only public members of your root mxml can be accessed in itemrendrer
using outerDocument variable.

On Sep 11, 9:21 pm, McRain <[email protected]> wrote:
> Hi!
> I have a code:
>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="absolute" >
> <mx:Script>
>         <![CDATA[
>                 private function myPrivateFunction(param:Object):void{
>                 }
>                 public function myPublicFunction(param:Object):void{
>                 }
>         ]]>
> </mx:Script>
>                 <mx:DataGrid id="dgGris" dataProvider="{mydp}" >
>                         <mx:columns>
>                                 <mx:DataGridColumn headerText="HEAD" 
> dataField="item">
>                                         <mx:itemRenderer>
>                                                 <mx:Component>
>                                                       <mx:Label 
> text="{myItemFunction()}">
>                                                           <mx:Script>
>                                                                         
> <![CDATA[
>                                                                               
>   private function myItemFunction():void{
>                                                                               
>           //Call from here to myPrivateFunction or myPublicFunction
>                                                                               
>   }
>                                                                         ]]>
>                                                                 </mx:Script>
>                                                       </mx:Label>
>                                                 </mx:Component>
>                                         </mx:itemRenderer>
>                                 </mx:DataGridColumn>
>                         </mx:columns>
>                 </mx:DataGrid>
> </mx:Application>
>
> How do I call a function (myPrivateFunction or myPublicFunction) from
> the myItemFunction? Application.application. myPrivateFunction - do
> not want to use.
> Thank you.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to