Loading ...
Sorry, an error occurred while loading the content.

11654Re: [ydn-javascript] Trouble with proxies

Expand Messages
  • Adam Moore
    Apr 2, 2007
      On Mon, Apr 02, 2007 at 08:53:11PM -0000, John Vieth wrote:
      > I created an example using dragdrop objects that works great, but I
      > can't get it to work when I change the objects from DD objects to
      > DDProxy objects. Here's a link to the working example using DD objects:
      > http://www.masterwebsmith.com/testajax.html
      > ...and here's a link to the same example except using DDProxy objects:
      > http://www.masterwebsmith.com/testajaxproxy.html
      > In the first example (that works), I am able to make the divs snap
      > back to their original position if they don't drop onto a valid
      > target, and if they *DO* drop on a valid target they swap position
      > with the target.
      > But in the second example (that doesn't work), the divs don't snap
      > back totheir original position onInvalidDrop, and when they swap
      > places with their target, they don't quite end up exactly where the
      > target was, but rather based on where the mouse cursor was--despite
      > the fact that I'm using the exact same code in both examples. The
      > only difference in the code is that the second example uses DDProxy
      > instead of DD. What gives? Please help me figure this out. Any
      > assistance would be greatly appreciated.

      John, to get the same behavior with DDProxy, you need to override
      endDrag. This will make it so the source element is not moved to the
      location you dragged the proxy, fixing your problem and also making the
      code you have in onInvalidDrop unnecessary.

    • Show all 4 messages in this topic