0 Replies Latest reply on Jun 30, 2011 7:01 AM by oziko

    Acces data from itemRenderer

    oziko Level 1

      Hi

      I have an external itemRenderer whith a textInput contol for a dataGrid column and I want to acces to the textInput text from the main component class.

       


      My code : main component class

      <s:GridColumn id="price" dataField="NS" headerText="Cost" width="75"
                                            itemRenderer="composants.myRenderer.ComponentInput" />

       

      the itemRenderer :

      <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                          xmlns:s="library://ns.adobe.com/flex/spark"
                          xmlns:mx="library://ns.adobe.com/flex/mx" clipAndEnableScrolling="true">
         
          <fx:Script>
              <![CDATA[
                  override public function prepare(hasBeenRecycled:Boolean):void {
                      //lblData.text = data[column.dataField]
                  }
              ]]>
          </fx:Script>
         
          <s:HGroup horizontalCenter="0" verticalCenter="0" >
              <s:TextInput id="price" textAlign="center" width="70"/>
             
          </s:HGroup>
         
      </s:GridItemRenderer>

       

       

      and from my main component class :

       

      protected function onPrice( event:MouseEvent ):void {
                     trace( price.itemRenderer.price )

                  }

      but it doesn't works.

      If someone have an idea??

      Thanks