1 Reply Latest reply on Jul 23, 2008 4:50 PM by GeorgeWS

    DataGrids and Drag and Drop

    GeorgeWS Level 1
      I have a datagrid that gets filled with a RO:

      <mx:DataGrid id="myDataGrid" dataProvider="{myData2}" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" itemClick="itemClicked(event)"
      <mx:columns>
      <mx:DataGridColumn dataField="PNUM5W" headerText="Code" minWidth="50"/>
      <mx:DataGridColumn dataField="PDES5W" headerText="Desc" minWidth="75"/>
      </mx:columns>
      </mx:DataGrid>

      This works great!
      I Drag and drop items from that grid to this grid:

      <mx:DataGrid id="dgSelected" dataProvider="[]" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" themeColor="#73B9B9" height="100%" width="100%">

      <mx:columns>
      <mx:DataGridColumn
      headerText="Code"
      width="30"
      dataField="PNUM5W"/>
      <mx:DataGridColumn
      headerText="Product"
      width="100"
      dataField="PDES5W" />
      </mx:columns>
      </mx:DataGrid>

      How do I get at the items in the droped datagrid? I am trying to have a "Print" button so the Main.mxml gets the items (hopefully in a string) '123','432','8765'. Then I can send those items off to a CFM page. I am doing this to do that... but it does not pick up the ItemID.

      private function gotoURL(myPNUM5W2Value:String) : void {
      var myobj:Object = new Object();
      myobj.PNUM5W = myPNUM5W2Value;
      var url:String = (" http://www.youngsmarket.com/test/list.cfm");
      var variables:URLVariables = new URLVariables();
      variables.Employee = Employee;
      variables.SupComp = SupComp;
      variables.ItemID = {program:myobj};
      var request:URLRequest = new URLRequest(url);
      request.data = variables;
      try {
      navigateToURL(request, 'Main');
      }
      }

      Thanks

      George
        • 1. Re: DataGrids and Drag and Drop
          GeorgeWS Level 1
          I think I could figure out what to do if I could get an example of how to pull the item out to say an Alert. I have an alert that show me each item each time i drop on in the new grid. I really new one that shows me what in the grid. Any thoughts would be great.

          G.