Provides the configuration for drop operations. Note: This configuration might be ignored due to control metadata restrictions.
Constructor for a new DropInfo.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new sap.ui.core.dnd.DropInfo(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new DropInfo, generated automatically if no ID is given |
|
mSettings? | object | Initial settings for the DropInfo |
Name | Type | Default Value | Description |
---|---|---|---|
dropEffect | sap.ui.core.dnd.DropEffect | Move | Defines the visual drop effect. Visibility: public |
dropLayout | sap.ui.core.dnd.DropLayout | Default | Defines the layout of the droppable controls if |
dropPosition | sap.ui.core.dnd.DropPosition | On | Defines the position for the drop action, visualized by a rectangle. Visibility: public |
targetAggregation | string | The aggregation name in the drop target control which is the target of this drag-and-drop action. If undefined, the entire control is the target. This can be handy if the target control does not have any aggregations or if the drop position within the target does not matter. Visibility: public |
Name | Type | Default Value | Description |
---|---|---|---|
enabled | boolean | true | Indicates whether this configuration is active or not. |
groupName | string | Defines the name of the group to which this object belongs. If |
Name | Cardinality | Type | Description |
---|---|---|---|
customData | 0..n | sap.ui.core.CustomData |
Custom Data, a data structure like a map containing arbitrary key value pairs. |
dependents | 0..n | sap.ui.core.Element |
Dependents are not rendered, but their databinding context and lifecycle are bound to the aggregating Element. |
dragDropConfig | 0..n | sap.ui.core.dnd.DragDropBase |
Defines the drag-and-drop configuration. Note: This configuration might be ignored due to control metadata restrictions. |
layoutData | 0..1 | sap.ui.core.LayoutData |
Defines the layout constraints for this control when it is used inside a Layout. LayoutData classes are typed classes and must match the embedding Layout. See VariantLayoutData for aggregating multiple alternative LayoutData instances to a single Element. |
tooltip | 0..1 | sap.ui.core.TooltipBase |
The tooltip that should be shown for this Element. In the most simple case, a tooltip is a string that will be rendered by the control and displayed by the browser when the mouse pointer hovers over the control's DOM. In this variant, Controls need to explicitly support this kind of tooltip as they have to render it, but most controls do. Exceptions will be documented for the corresponding controls (e.g. Alternatively, UI5 currently does not provide a recommended implementation of See the section Using Tooltips
|
Event | Description |
---|---|
dragEnter |
This event is fired when a dragged element enters a drop target. |
dragOver |
This event is fired when an element is being dragged over a valid drop target. |
drop |
This event is fired when an element is dropped on a valid drop target, as specified by the drag-and-drop info. |
This event is fired when a dragged element enters a drop target.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
target | sap.ui.core.Element |
The target element on which the dragged element will be dropped |
dragSession | sap.ui.core.dnd.DragSession |
The UI5 |
browserEvent | Event |
The underlying browser event |
This event is fired when an element is being dragged over a valid drop target.
Since: 1.56.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
target | sap.ui.core.Element |
The target element on which the dragged element will be dropped |
dragSession | sap.ui.core.dnd.DragSession |
The UI5 |
dropPosition | string |
The calculated position of the drop action relative to the |
browserEvent | Event |
The underlying browser event |
This event is fired when an element is dropped on a valid drop target, as specified by the drag-and-drop info.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
dragSession | sap.ui.core.dnd.DragSession |
The UI5 |
draggedControl | sap.ui.core.Element |
The element being dragged |
droppedControl | sap.ui.core.Element |
The element being dropped |
dropPosition | string |
The calculated position of the drop action relative to the |
browserEvent | Event |
The underlying browser event |
Method | Description |
---|---|
attachDragEnter |
Attaches event handler When called, the context of the event handler (its This event is fired when a dragged element enters a drop target. |
attachDragOver |
Attaches event handler When called, the context of the event handler (its This event is fired when an element is being dragged over a valid drop target. |
attachDrop |
Attaches event handler When called, the context of the event handler (its This event is fired when an element is dropped on a valid drop target, as specified by the drag-and-drop info. |
detachDragEnter |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachDragOver |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachDrop |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.core.dnd.DropInfo.extend |
Creates a new subclass of class sap.ui.core.dnd.DropInfo with name
|
fireDragEnter |
Fires event dragEnter to attached listeners. Listeners may prevent the default action of this event by calling the |
fireDragOver |
Fires event dragOver to attached listeners. |
fireDrop |
Fires event drop to attached listeners. |
getDropEffect |
Gets current value of property dropEffect. Defines the visual drop effect. Default value is |
getDropLayout |
Gets current value of property dropLayout. Defines the layout of the droppable controls if Default value is |
getDropPosition |
Gets current value of property dropPosition. Defines the position for the drop action, visualized by a rectangle. Default value is |
sap.ui.core.dnd.DropInfo.getMetadata |
Returns a metadata object for class sap.ui.core.dnd.DropInfo. |
getTargetAggregation |
Gets current value of property targetAggregation. The aggregation name in the drop target control which is the target of this drag-and-drop action. If undefined, the entire control is the target. This can be handy if the target control does not have any aggregations or if the drop position within the target does not matter. |
setDropEffect |
Sets a new value for property dropEffect. Defines the visual drop effect. When called with a value of Default value is |
setDropLayout |
Sets a new value for property dropLayout. Defines the layout of the droppable controls if When called with a value of Default value is |
setDropPosition |
Sets a new value for property dropPosition. Defines the position for the drop action, visualized by a rectangle. When called with a value of Default value is |
setTargetAggregation |
Sets a new value for property targetAggregation. The aggregation name in the drop target control which is the target of this drag-and-drop action. If undefined, the entire control is the target. This can be handy if the target control does not have any aggregations or if the drop position within the target does not matter. When called with a value of |
Attaches event handler fnFunction
to the dragEnter event of this sap.ui.core.dnd.DropInfo
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.core.dnd.DropInfo
itself.
This event is fired when a dragged element enters a drop target.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the dragOver event of this sap.ui.core.dnd.DropInfo
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.core.dnd.DropInfo
itself.
This event is fired when an element is being dragged over a valid drop target.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the drop event of this sap.ui.core.dnd.DropInfo
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.core.dnd.DropInfo
itself.
This event is fired when an element is dropped on a valid drop target, as specified by the drag-and-drop info.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Detaches event handler fnFunction
from the dragEnter event of this sap.ui.core.dnd.DropInfo
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the dragOver event of this sap.ui.core.dnd.DropInfo
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the drop event of this sap.ui.core.dnd.DropInfo
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Creates a new subclass of class sap.ui.core.dnd.DropInfo with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.core.dnd.DragDropBase.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires event dragEnter to attached listeners.
Listeners may prevent the default action of this event by calling the preventDefault
method on the event object. The return value of this method indicates whether the default action should be executed.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event dragOver to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event drop to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Gets current value of property dropEffect.
Defines the visual drop effect.
Default value is "Move"
.
Gets current value of property dropLayout.
Defines the layout of the droppable controls if dropPosition
is set to Between
or OnOrBetween
.
Default value is "Default"
.
Gets current value of property dropPosition.
Defines the position for the drop action, visualized by a rectangle.
Default value is "On"
.
Gets current value of property targetAggregation.
The aggregation name in the drop target control which is the target of this drag-and-drop action. If undefined, the entire control is the target. This can be handy if the target control does not have any aggregations or if the drop position within the target does not matter.
Sets a new value for property dropEffect.
Defines the visual drop effect.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is "Move"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sDropEffect | sap.ui.core.dnd.DropEffect | "Move" |
New value for property |
Sets a new value for property dropLayout.
Defines the layout of the droppable controls if dropPosition
is set to Between
or OnOrBetween
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is "Default"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sDropLayout | sap.ui.core.dnd.DropLayout | "Default" |
New value for property |
Sets a new value for property dropPosition.
Defines the position for the drop action, visualized by a rectangle.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is "On"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sDropPosition | sap.ui.core.dnd.DropPosition | "On" |
New value for property |
Sets a new value for property targetAggregation.
The aggregation name in the drop target control which is the target of this drag-and-drop action. If undefined, the entire control is the target. This can be handy if the target control does not have any aggregations or if the drop position within the target does not matter.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTargetAggregation | string |
New value for property |