1 Reply Latest reply on Sep 23, 2008 8:14 PM by Sbanmai

    AdvanvancedDataGrid Bug

    Sbanmai
      Hi All,

      Does anyone has the same problem as mine or having any suggestion for me, help me pleaseee...
      My work is to provide drag and drop functionality to the advanced data grid components as shown in
      the code example below. At first they seem to work fine but I found the problem that when right click
      on the advanced data grid then I will no longer drag on drop. I guess this is a advanced data grid bug.

      Here is an exact step to produce this issue:
      1. Run this Flex Window Application program in full screen mode.
      2. Drag and Drop up and down across both advanced data grid as you please.
      3. "Make sure there is no row in both advanced data grid is selected"
      4. Just highlight on any row on the top advanced data grid then right click one time.

      You will notice that you can no longer drag and drop after this point.
      The key is that if you left click on any row before right click it has no problem,
      you must drag and drop for at least one time before you try to right click so that the problem
      will occur. (do whatever you want -> drag/drop as you please -> highlight a row without left click -> you can no longer drag and drop)

      Please let me know you guys suggestion, thanks a million in advance.

      - Ozzie

      ========================================================================================== =============
      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;

      [Bindable]
      private var dpFlat:ArrayCollection = new ArrayCollection([
      {Region:"Southwest", Territory:"Arizona",
      Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000},
      {Region:"Southwest", Territory:"Arizona",
      Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000},
      {Region:"Southwest", Territory:"Central California",
      Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000},
      {Region:"Southwest", Territory:"Nevada",
      Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000},
      {Region:"Southwest", Territory:"Northern California",
      Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000},
      {Region:"Southwest", Territory:"Northern California",
      Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000},
      {Region:"Southwest", Territory:"Southern California",
      Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000},
      {Region:"Southwest", Territory:"Southern California",
      Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000}
      ]);

      [Bindable]
      private var dpFlat2:ArrayCollection = new ArrayCollection([
      {Region:"Southwest", Territory:"Arizona",
      Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000},
      {Region:"Southwest", Territory:"Arizona",
      Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000},
      {Region:"Southwest", Territory:"Central California",
      Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000},
      {Region:"Southwest", Territory:"Nevada",
      Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000},
      {Region:"Southwest", Territory:"Northern California",
      Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000},
      {Region:"Southwest", Territory:"Northern California",
      Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000},
      {Region:"Southwest", Territory:"Southern California",
      Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000},
      {Region:"Southwest", Territory:"Southern California",
      Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000}
      ]);
      ]]>
      </mx:Script>

      <mx:Panel title="AdvancedDataGrid Control Example" id="p1"
      height="340" width="100%" layout="horizontal"
      paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10" x="0" y="0">

      <mx:AdvancedDataGrid id="myADG"
      width="100%" height="100%"
      initialize="gc.refresh();" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true">
      <mx:dataProvider>
      <mx:GroupingCollection id="gc" source="{dpFlat}">
      <mx:grouping>
      <mx:Grouping>
      <mx:GroupingField name="Region"/>
      <mx:GroupingField name="Territory"/>
      </mx:Grouping>
      </mx:grouping>
      </mx:GroupingCollection>
      </mx:dataProvider>

      <mx:columns>
      <mx:AdvancedDataGridColumn dataField="Region"/>
      <mx:AdvancedDataGridColumn dataField="Territory"/>
      <mx:AdvancedDataGridColumn dataField="Territory_Rep"
      headerText="Territory Rep"/>
      <mx:AdvancedDataGridColumn dataField="Actual"/>
      <mx:AdvancedDataGridColumn dataField="Estimate"/>
      </mx:columns>
      </mx:AdvancedDataGrid>
      </mx:Panel>

      <mx:Panel title="AdvancedDataGrid Control Example"
      height="50%" width="100%" layout="horizontal" id="p2"
      paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10" x="0" y="338">
      <mx:AdvancedDataGrid id="myADG2"
      width="100%" height="100%"
      initialize="gc2.refresh();" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true">
      <mx:dataProvider>
      <mx:GroupingCollection id="gc2" source="{dpFlat2}">
      <mx:grouping>
      <mx:Grouping>
      <mx:GroupingField name="Region"/>
      <mx:GroupingField name="Territory"/>
      </mx:Grouping>
      </mx:grouping>
      </mx:GroupingCollection>
      </mx:dataProvider>

      <mx:columns>
      <mx:AdvancedDataGridColumn dataField="Region"/>
      <mx:AdvancedDataGridColumn dataField="Territory"/>
      <mx:AdvancedDataGridColumn dataField="Territory_Rep"
      headerText="Territory Rep"/>
      <mx:AdvancedDataGridColumn dataField="Actual"/>
      <mx:AdvancedDataGridColumn dataField="Estimate"/>
      </mx:columns>
      </mx:AdvancedDataGrid>

      </mx:Panel>
      </mx:WindowedApplication>
      ========================================================================================== ===========
        • 1. Re: AdvanvancedDataGrid Bug
          Sbanmai Level 1
          I use also change from Native drag-drop to custom drag-drop it doesn't work anyway. It seem that it lost drag-drop event, drag start event never start too.

          I'd like to have some work around to fix this issue...

          anyone/Adobe help me pleaseee

          Ozzie