2 Replies Latest reply on Aug 8, 2010 4:09 PM by Shongrunden

    DropDownList dataProvider in itemRenderer ?  AdvancedDataGrid

    zenocon

      Can someone tell me what's wrong with this code?  It generates the error:

       

      1120: Access of undefined property list

       

      List exists, but it seems like the scope of the DropDownList can't see
      it?  I've seen other example like this...how can I bind to the
      dataProvider on the list if the property/var lives in the parent
      container?

       


      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                xmlns:s="library://ns.adobe.com/flex/spark"
                                xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
             <fx:Script>
                     <![CDATA[
                             import mx.collections.ArrayCollection;

       

                             [Bindable]
                             public var list:Array = ["one", "two", "three"];
                     ]]>
             </fx:Script>

       

             <mx:AdvancedDataGrid id="grid"
                                                      width="100%" height="100%">
                     <mx:columns>
                             <mx:AdvancedDataGridColumn >
                                     <mx:itemRenderer>
                                             <fx:Component>
                                                     <s:DropDownList dataProvider = "{list}"/>
                                             </fx:Component>
                                     </mx:itemRenderer>
                             </mx:AdvancedDataGridColumn>
                     </mx:columns>
             </mx:AdvancedDataGrid>
      </s:Application>