0 Replies Latest reply on Apr 7, 2009 8:01 AM by Handycam

    How to access Dropped datagrid items?

    Handycam Level 1

      I have an MXML component that has 2 datagrids, where the user drags items from one to the other.

       

      They are bound to these 2 variables:

      [Bindable]

      public var itemChoicesList:XMLList;

      [Bindable]

      public var itemChosenList:ArrayCollection;

       

      I was using an array collection since later I need to do some concatenating of all the steps; it I can do this with XMLList, please let me know.

       

      Anyhow:

       

      The left one is:

      <mx:DataGrid id="choices"  dataProvider="{itemChoicesList}" width="100%" height="100%"

      wordWrap="true" variableRowHeight="true" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"

      styleName="promptGrid" showHeaders="false">

      <mx:columns>

      <mx:DataGridColumn dataField="@ln1" headerText=""/>

      </mx:columns>

      </mx:DataGrid>

       

      The right one:

      <mx:DataGrid id="chosen" dataProvider="{chosenList}" width="100%" height="100%"

      wordWrap="true" variableRowHeight="true" editable="true" dropEnabled="true"

      dragEnabled="true" dragMoveEnabled="true"  styleName="promptGrid"

      dragEnter="dragEnterChosen(event)" dragDrop="dragDropChosen(event)" showHeaders="false">

      <mx:columns>

      <mx:DataGridColumn dataField="@ln1" headerText="" editable="false" />

      </mx:columns>

      </mx:DataGrid>

       

      OK, fine.  I populate the "choices" one when I instantiate the component, from the parent app:

      recipeStep.itemChoicesList = step..item;

       

      Works fine.  I can drag items over, great.   My question is, I need to access the items in this datagrid from other places in the application, as they are dropped.  What is the best way to do this?