Dropping
Thus far, this chapter has focused on
dragging objects around on the screen. This
section wraps up the discussion by focusing in on the
dropping part of it all. To get started, let's
first take a look at dojo.dnd.Source, a special container class
the toolkit provides a drag-and-drop source. A Source can also act as a target for a drop,
but as we'll see in a moment, you can also specify a "pure" target
with dojo.dnd.Target. While a
Source may act as an origin and a
destination, a Target may only act
as a destination.
Creating a Source is just
like creating a Moveable ; you call
the constructor function and pass in a node as the first argument and
an Object of parameters as the
second argument, like so. Table 7-3 lists the relevant
methods.
Table 7-3. Creating and destroying a Source
Name | Comment |
|---|---|
| Constructor method for
creation. Valid values for |
| Prepares the |
Table 7-4
summarizes key parameters involved in the creation of a Source object.
Table 7-4. Configuration parameters for Source's params in Table 7-3
Parameter | Type | Comment |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access