Summary

Tip

For a really practical example of drag-and-drop at work, be sure to check out ""Drag-and-Drop with the Tree" in Chapter 15, where drag-and-drop is applied to the problem of manipulating the Tree dijit. The Tree is a phenomenal piece of engineering and dnd only makes it better!

After reading this chapter, you should be able to:

  • Construct unconstrained Moveable objects and drag them around on the screen

  • Define constraints for Moveable objects to control their behavior

  • Be able to implement Source and Target containers to create collections of items that can be dragged and dropped to/from/within one another

  • Create custom avatars to communicate with the user when a drop operation is about to occur

  • Use dojo.connect and dojo.subscribe to receive event notifications for drag-and-drop objects

Next, we'll cover animation and special effects.

Get Dojo: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.