0 Replies Latest reply on May 12, 2011 8:27 AM by rcjetpilot

    using one comboBox itemEditor to manipulate two columns in a dataGrid

    rcjetpilot

      Here is my delima:  I have an itemEditor that has a two colum datasource.  The Field "LongName" is what I wat to show the user in the combobox.  Thats all working great.  But when the change event happens on the "LongName" column, I also want a second column updated to capture the "PipelineID" as it changes from the selecteditem in the combobox.  I am a little lost as how to accomplish this, I've tried a couple of ways unsuccessfully.  Here is my datagrid code below.

       

      As a second feature I also want the selected "PipelineID" to be used where the "8" is hard coded in this following line of code.

       

      outerDocument.SelectTerminalListResult.token = outerDocument.contract.SelectTerminalList(8);

       

       

      <!---    GRID CODE     --->

       

       

       

      <s:Panel x="10" y="189" width="639" height="193" title="LOCATIONS AND PRICING" id="LocationPanel">

       

       

      <mx:DataGrid x="12" y="13" width="614" height="134" id="grid" fontWeight="bold" editable="true" dataProvider="{LocationPrice}">

       

       

      <mx:columns>

       

       

      <mx:DataGridColumn headerText="LINE #" dataField="item" editable="false" width="60"/>

       

       

      <mx:DataGridColumn headerText="LOCATION" dataField="LongName" editable="true" width="120" >

       

       

      <mx:itemEditor>

       

       

      <fx:Component>

       

       

      <mx:ComboBox labelField="LongName" dataProvider="{outerDocument.SelectPipelineListResult.lastResult}"

      name="

      PipelineList" change="PipelineList_changeHandler(event)">

       

       

      <fx:Script>

      <![CDATA[

       

       

      import mx.events.ListEvent;

       

       

      protected function PipelineList_changeHandler(event:ListEvent):void

      {

       

      outerDocument.SelectTerminalListResult.token = outerDocument.contract.SelectTerminalList(8);

       

      }

       

      ]]>

       

       

      </fx:Script>

       

       

      </mx:ComboBox>

       

        

       

       

      </fx:Component>

       

       

      </mx:itemEditor>

       

       

      </mx:DataGridColumn>

       

       

       

      <mx:DataGridColumn id="SelectedPipelineID" dataField="PipeLineID">

       

       

      <mx:itemEditor>

       

       

      <fx:Component>

      <mx:TextInput>

       

      </mx:TextInput>

       

       

      </fx:Component>

       

       

      </mx:itemEditor>

       

       

       

      </mx:DataGridColumn>

       

       

       

      <mx:DataGridColumn headerText="TERMINAL" dataField="terminal" editable="true" width="120">

       

      <mx:itemEditor>

       

      <fx:Component>

       

      <mx:ComboBox labelField="LongName" dataProvider="{outerDocument.SelectTerminalListResult.lastResult}"/>

       

      </fx:Component>

       

      </mx:itemEditor>

       

      </mx:DataGridColumn>

       

      <mx:DataGridColumn headerText="BASE COST" dataField="basecost" editable="true" width="90"/>

       

      <mx:DataGridColumn headerText="DIFF" dataField="diff" editable="true" />

       

      <mx:DataGridColumn headerText="TARIFF" dataField="tariff" editable="true" />

       

      <mx:DataGridColumn headerText="OTHER" dataField="other" editable="true" />

       

      <mx:DataGridColumn headerText="TOTAL" dataField="total" editable="false" />

       

      </mx:columns>

       

      </mx:DataGrid>