3 Replies Latest reply on Jan 24, 2011 11:00 PM by linrsvp

    How do I call a function from an Itemrenderer?

    vachik79

      Hi, Im new in flex and I wonder if I can call a function from within an AdvancedDataGridRendererProvider

       

      for example:

       

        <mx:AdvancedDataGrid>
        ......
          <mx:columns>
              <mx:AdvancedDataGridColumn  dataField="id" />
             .....
          </mx:columns>  
             
          <mx:rendererProviders> 
                   
              <mx:AdvancedDataGridRendererProvider 
                  dataField="detail"
                  renderer="components.myRendererProvider"  
                  columnIndex="2" 
                  depth="2"                     
                  />     
            
                 ........     
                         
          </mx:rendererProviders>       
        </mx:AdvancedDataGrid>

      <mx:Script>
           <![CDATA[

                public function outerFunction(){

               

                }

         
          ]]>
      </mx:Script>

       

      ---------------------------------

      myRendererProvider

      ---------------------------------

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" paddingLeft="10" paddingRight="2" horizontalGap="2" paddingTop="0">
      <mx:Script>
          <![CDATA[   
             
           public function callOuterFunction( ){

                how do I call the outerFunction() from here?
           }
         
          ]]>
      </mx:Script>
         
          <mx:LinkButton fontSize="13"  fontWeight="bold" click="callOuterFunction( )" label="label"  />
      </mx:HBox>

       

      thank you in advance.