jQuery in Action
Introduction to the UI Plugin
315
Drag-and-drop is a useful interaction technique for many purposes. It's fre-
quently used to indicate association but may also be used to rearrange the order
of elements. This latter use is common enough to warrant direct support by the
quently used to indicate association but may also be used to rearrange the order
of elements. This latter use is common enough to warrant direct support by the
UI
Plugin. Let's look into that.
Other mouse interaction methods
The remaining category of commands in the mouse interaction category of the
UI
Plugin are sortables, selectables and resizables. The methods in these categories
leverage the drag-and-drop capability to allow elements to be reordered within a
container and resized, respectively.
container and resized, respectively.
As with the
UI
Plugin commands we've examined so far, each of these operates
by applying methods to a matched set and passing in an object hash that specifies
the options. For complete details, please refer to http://docs.jquery.com/
the options. For complete details, please refer to http://docs.jquery.com/
UI
.
In addition to dynamic drag-and-drop and other mouse interaction opera-
tions, the
UI
Plugin also provides a number of widgets that we can use to extend
the basic set of user interface elements that are natively provided by
HTML
.
Command syntax: droppableDisable
droppableDisable()
Suspends droppability of the wrapped droppable elements without removing the droppability
information or options
information or options
Parameters
none
Returns
The wrapped set
The wrapped set
Command syntax: droppableEnable
droppableEnable()
Restores droppability to any droppables in the matched set that had been disabled via
droppableDisable()
Parameters
none
Returns
The wrapped set
The wrapped set