docs

Drag-and-Drop Metadata

To influence the drag-and-drop behavior, use the metadata definition of a control.


Overview

You can use the dnd key for the drag-and-drop behavior of a control. Here is an example that shows you how the dnd key can be used:

Control.extend('my.CustomControl', {
      metadata : {
          properties : {
              value : { type : 'string' },
              width : { type : 'sap.ui.core.CSSSize', defaultValue : 'auto' }
          },
          dnd : { draggable: false, droppable: true },
          aggregations : {
              header : { type : "sap.ui.core.Control", multiple : false, dnd : true },
              items : { type: 'sap.ui.core.Control', multiple : true, selector : "#{id}-items", dnd : {
                       draggable: true, dropppable: true, layout: "Horizontal"
              } },
          }
     }

You can use the following attributes in the metadata of a control for drag and drop:

Related Information

API Reference: sap.ui.core.Element.extend

API Reference: sap.ui.base.ManagedObject.extend