3 Replies Latest reply on Oct 17, 2007 2:41 PM by ntsiii

    refer to a comboBox

    Level 7
      Hi All,
      I have a comboBox inside a datagrid in a form.
      How can I refer to this comboBox (rate_cb) outside the datagrid?
      parentDocument. ?????

      Tks
      JFB

      <mx:DataGrid id="price_dg" x="10" y="32" width="590" height="147"
      editable="true">
      <mx:columns>
      <mx:DataGridColumn headerText="Quantity" dataField="qty"
      labelFunction="formatNumber"/>
      <mx:DataGridColumn headerText="Rate Type" dataField="id"
      rendererIsEditor="true" editorDataField="dummy" width="120">
      <mx:itemRenderer>
      <mx:Component>
      <mx:VBox>
      <mx:ComboBox id="rate_cb" dataProvider="{outerDocument.acRate}"
      labelField="label" width="120"/>
      </mx:VBox>
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>
      <mx:DataGridColumn headerText="per Piece" dataField="perpiece"
      editable="false"/>
      </mx:columns>
      </mx:DataGrid>


        • 1. Re: refer to a comboBox
          ntsiii Level 3
          Essentially, you can't.

          Remember that item renderers are re-cycled when the data changes or when you scroll.

          You must have your combobox update a property in the dataProvider item, then access the data from that.

          Tracy
          • 2. Re: refer to a comboBox
            Level 7
            Thanks for you reply.
            But how can I do this?
            Any example please.

            Johnny

            "ntsiii" <tspratt@lariatinc.com> wrote in message
            news:ff0tnl$bj4$1@forums.macromedia.com...
            > Essentially, you can't.
            >
            > Remember that item renderers are re-cycled when the data changes or when
            > you
            > scroll.
            >
            > You must have your combobox update a property in the dataProvider item,
            > then
            > access the data from that.
            >
            > Tracy
            >


            • 3. Re: refer to a comboBox
              ntsiii Level 3
              <mx:ComboBox id="rate_cb"
              dataProvider="{outerDocument.acRate}"
              selectedIndex="data.selectedIndex"
              change="data.selectedIndex=rate_cb.selectedIndex"
              labelField="label" width="120"/>