Ryan Gahl
2006-Apr-06 16:03 UTC
RE: Drag and drop events. Or: How I learned to takeover the world.
You should open up dragdrop.js in the scriptaculous directory and take a look at the interface for Draggables/Draggable. There is an event for dragStart, dragging, and dragEnd (not by those exact names but you should see them)... sorry I can''t offer more help than just pointing you in the right direction... very busy. Good luck, nice start! The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Ryan Gahl
2006-Apr-06 16:59 UTC
RE: Drag and drop events. Or: How I learned to takeover the world.
Ok, since a couple people seem to be having problems with this, I dug into some of my code to find the exact solution... you need to register an observer object with the Draggables.addObserver() method. In this observer object, you can test the draggable params in the associated methods to make sure the draggable is the one you''re looking for that specific action... var myDraggable = new Draggable($(''someElement''), dragOptions); var myDraggableObserver = { onStart: function(eventName, draggable, event) { if (draggable == myDraggable) { //take action (dragging has started) } }, onDrag: function(eventName, draggable, event) { if (draggable == myDraggable) { //take action (dragging is going on) } }, onEnd: function(eventName, draggable, event) { if (draggable == myDraggable) { //take action (dragging has stopped) } } } Draggables.addObserver(this.moveableObserver); The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.