6 Replies Latest reply on Feb 18, 2009 8:42 AM by mr_bleu

    drag&drop datagrid - autoscroll

    mr_bleu
      Hi,

      I have two DataGrid with 5 rows visibles but with 20 data.

      I enabled the drag&drop functionnality between two DataGrid
      and this is the following code for the dropping operation:

      // avoid the default behavior
      evt.preventDefault();

      // remove the black line when dropped
      evt.currentTarget.hideDropFeedback(evt);

      [other code that will insert the row inside the datagrid, not important...]

      So, when dropping a row inside the other DataGrid, this component will auto-scroll when I move the mouse up or down even if the cursor is outside of the component. This never stop.

      I don't know if it's a feature or a bug , but I'm trying to list all eventlistener from this component so I can remove events MOUSE_UP and MOUSE_DOWN in drop event so I can stop it.

      Is anyone having similar issues ? Do you have any tips on how I can list all evenlistener from a component?

      Thank you!
        • 1. Re: drag&drop datagrid - autoscroll
          Level 7

          "mr_bleu" <webforumsuser@macromedia.com> wrote in message
          news:gnelom$gpc$1@forums.macromedia.com...
          > Hi,
          >
          > I have to boxes with 5 rows visibles but with 20 data.
          >
          > I enabled the drag&drop functionnality between two DataGrid
          > and this is the following code for the dropping operation:
          >
          > // avoid the default behavior
          > evt.preventDefault();
          >
          > // remove the black line when dropped
          > evt.currentTarget.hideDropFeedback(evt);
          >
          > [other code that will insert the row inside the datagrid, not
          > important...]
          >
          > So, when dropping a row inside the other DataGrid, this component will
          > auto-scroll when I move the mouse up or down even if the cursor is outside
          > of
          > the component. This never stop.
          >
          > I don't know if it's a feature or a bug , but I'm trying to list all
          > eventlistener from this component so I can remove events MOUSE_UP and
          > MOUSE_DOWN in drop event so I can stop it.
          >
          > Is anyone having similar issues ? Do you have any tips on how I can list
          > all
          > evenlistener from a component?

          I would think that this would be related to mouse_move?


          • 2. Re: drag&amp;drop datagrid - autoscroll
            mr_bleu Level 1
            Yes, probably! What I want is to stop the auto-scroll after a drop..

            It's very easy to reproduce, create two DataGrid with more data than visible rows and use the method of manual drag&drop, you'll see the 'bug' or 'feature'.
            • 3. drag&amp;drop datagrid - autoscroll
              mr_bleu Level 1
              Attached is the full code that contains the bug. Just drag at least 6 numbers from the first DataGrid to the second DataGrid and then move your mouse up and down. The second box scroll will go up and down depending of your mouse...
              • 4. Re: drag&amp;drop datagrid - autoscroll
                rtalton Level 4
                Look into moving the focus away from the Data Grid after the drop...move it to another component.
                • 5. Re: drag&amp;drop datagrid - autoscroll
                  mr_bleu Level 1
                  quote:

                  Originally posted by: rtalton
                  Look into moving the focus away from the Data Grid after the drop...move it to another component.


                  Hi,

                  I'm sorry, but I don't understand what do you mean? Could you provide me a small example of code please?

                  Thank you!

                  • 6. Re: drag&amp;drop datagrid - autoscroll
                    mr_bleu Level 1
                    Hi,

                    If you talk about the event listener of FOCUS of the destination target (second DataGrid), the "target" property is read-only.

                    If you talk about the focusManager.setFocus(), nope, doesn't work at all, even if I set the focus on another component, the destination will still autoscroll.

                    Thanks!