Zimlet JavaScript API Reference - DwtDropTarget

Class DwtDropTarget


A drop target is registered with a control to indicate that the control is a drop target. The drop target is the mechanism by which the DnD framework provides the binding between the UI components and the application.

Application developers instantiate DwtDropTarget and register it with the control which is to be a drop target (via DwtControl.setDropTarget). The application should then register a listener with the DwtDropTarget. This way when drop events occur the application will be notified and may act on them accordingly



Defined in: DwtDropTarget.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
DwtDropTarget(transferType)
Method Summary
Method Attributes Method Name and Description
 
addDropListener(dropTargetListener)
Registers a listener for DwtDragEvent events.
 
Declares a type of object as valid for being dropped onto this target.
 
Gets the transfer types.
 
Checks if the UI component backing this drop target has multiple sub-components.
 
Check to see if the types in items can be dropped on this drop target
 
Calling this method indicates that the UI component backing this drop target has multiple sub-components
 
removeDropListener(dropTargetListener)
Removes a registered event listener.
 
Returns a string representation of this object.
Class Detail
DwtDropTarget(transferType)

Author: Ross Dargahi.
Parameters:
{array} transferType
a list of supported object types that may be dropped onto this drop target. Typically the items represent classes (i.e. functions) whose instances may be dropped on this drop target e.g. new DwtDropTarget(MailItem, AppointmentItme)
See:
DwtDropEvent
DwtControl
DwtControl#setDropTarget
Method Detail
addDropListener(dropTargetListener)
Registers a listener for DwtDragEvent events.
Parameters:
{AjxListener} dropTargetListener
Listener to be registered
See:
DwtDropEvent
AjxListener
#removeDropListener

addTransferType(type)
Declares a type of object as valid for being dropped onto this target. The type is provided as a string, since the corresponding class may not yet be defined. The type is eval'ed before it is used for any validation, since the check is done with instanceof.
Parameters:
{string} type
the name of class

{array} getTransferTypes()
Gets the transfer types.
Returns:
{array} the list of transfer types supported by this drop target
See:
#setTransferTypes

{boolean} hasMultipleTargets()
Checks if the UI component backing this drop target has multiple sub-components.
Returns:
{boolean} true if the UI component has multiple sub-components

{boolean} isValidTarget(items)
Check to see if the types in items can be dropped on this drop target
Parameters:
{object|array} items
an array of objects or single object whose types are to be checked against the set of transfer types supported by this drop target
Returns:
true if all of the objects in items may legally be dropped on this drop target

markAsMultiple()
Calling this method indicates that the UI component backing this drop target has multiple sub-components

removeDropListener(dropTargetListener)
Removes a registered event listener.
Parameters:
{AjxListener} dropTargetListener
Listener to be removed
See:
AjxListener
#addDropListener

{string} toString()
Returns a string representation of this object.
Returns:
{string} a string representation of this object

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:26 GMT-0400 (EDT)