I have a series of ContentPane based widgets (enhanced with drag and drop) that sit on my page. I want to be able to drag them around inside a container, however I do not want them to go outside the bounds of that container... I want them to just sort of bump up against the side of the container.
Is there an easy way to do this?

Yes
I can only speak for 0.9: Yes, there is. When constructing the dojo.dnd.Moveable instance for the node you're moving, in the options object (the second parameter of the Moveable constructor), provide a "mover" option like so:
mover: dojo.dnd.parentConstrainedMover("contents", true),
});
dojo.dnd.parentConstrainedMover is a function that returns a constructor for a dojo.dnd.Mover instance that doesn't let the node get moved outside its parent's bounding box. See dojo/dnd/move.js for details of the two parameters to the function; the ones I've shown are typically what you'll want, but there are other choices.
I'm hoping to get a suggestion accepted that will change this slightly (see this thread and this trac ticket), but the change to your source if that happens will be quite small.
Hope this helps,
--
T.J. Crowder
tj at crowder software dot com
drag.constrainTo();
it looks like in .04 you can use drag.constrainTo(); to constrain it's parent container... only some weird behavior happens...
If I have one draggable widget in the container, it is fine. But if I add another draggable widget to the same container, then that new widget's container bounds are then moved to the right directly equivalent to the width of the previous module. So basically that new widget will then move outside the original containers bounds to the right, but can never move farther left than where the first widget ended. Does that make sense?
So weird.
So I'm thinking maybe I have to put in a hack that when the second widget is dragged, it does some logic to change the bounds of the parent container somehow.
Any thoughts?
hey MrRyansan
i spent so much time in getting widgets into a DnD container and havent succeed yet.. can u publish some code snippets of how u created them and put them inside a DnD container?
that would be a real cool move
-Norman
dojo drag and drop
i am working with dojo 1.0.4
i want a drag and drop functionality where two or more floating panes could be replaced each other while dragging
is there any such function available in later versions of dojo?
-Nandhini Jayakumar