Provides the configuration for drag-and-drop operations.
Note: This configuration might be ignored due to control metadata restrictions.
Constructor for a new DragDropInfo.
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.DragDropInfo(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new DragDropInfo, generated automatically if no ID is given |
|
mSettings? | object | Initial settings for the DragDropInfo |
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 |
|
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
|
Name | Cardinality | Type | Description |
---|---|---|---|
targetElement | 0..1 | sap.ui.core.Element |
The target element for this drag and drop action. If undefined, the control with this drag and drop configuration itself is the target. Leaving this empty, but defining source and target aggregation, allows you to reorder the children within a control, for example. |
This event is fired when a drag operation is being ended.
Since: 1.56.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
This event is fired when the user starts dragging an element.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
target | sap.ui.core.Element |
The target element that will be dragged |
dragSession | sap.ui.core.dnd.DragSession |
The UI5 |
browserEvent | Event |
The underlying browser event |
Method | Description |
---|---|
attachDragEnd |
Attaches event handler When called, the context of the event handler (its This event is fired when a drag operation is being ended. |
attachDragStart |
Attaches event handler When called, the context of the event handler (its This event is fired when the user starts dragging an element. |
detachDragEnd |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachDragStart |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.core.dnd.DragDropInfo.extend |
Creates a new subclass of class sap.ui.core.dnd.DragDropInfo with name
|
fireDragEnd |
Fires event dragEnd to attached listeners. |
fireDragStart |
Fires event dragStart to attached listeners. Listeners may prevent the default action of this event by calling the |
sap.ui.core.dnd.DragDropInfo.getMetadata |
Returns a metadata object for class sap.ui.core.dnd.DragDropInfo. |
getSourceAggregation |
Gets current value of property sourceAggregation. The name of the aggregation from which all children can be dragged. If undefined, the control itself can be dragged. |
getTargetElement |
ID of the element which is the current target of the association targetElement, or |
setSourceAggregation |
Sets a new value for property sourceAggregation. The name of the aggregation from which all children can be dragged. If undefined, the control itself can be dragged. When called with a value of |
setTargetElement |
Sets the associated targetElement. |
Attaches event handler fnFunction
to the dragEnd event of this sap.ui.core.dnd.DragDropInfo
.
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.DragDropInfo
itself.
This event is fired when a drag operation is being ended.
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 dragStart event of this sap.ui.core.dnd.DragDropInfo
.
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.DragDropInfo
itself.
This event is fired when the user starts dragging an element.
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 dragEnd event of this sap.ui.core.dnd.DragDropInfo
.
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 dragStart event of this sap.ui.core.dnd.DragDropInfo
.
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.DragDropInfo 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.DropInfo.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 dragEnd to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event dragStart 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 |
Returns a metadata object for class sap.ui.core.dnd.DragDropInfo.
Gets current value of property sourceAggregation.
The name of the aggregation from which all children can be dragged. If undefined, the control itself can be dragged.
ID of the element which is the current target of the association targetElement, or null
.
Sets a new value for property sourceAggregation.
The name of the aggregation from which all children can be dragged. If undefined, the control itself can be dragged.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sSourceAggregation | string |
New value for property |
Sets the associated targetElement.
Param | Type | DefaultValue | Description |
---|---|---|---|
oTargetElement | sap.ui.core.ID sap.ui.core.Element |
ID of an element which becomes the new target of this targetElement association; alternatively, an element instance may be given |