onDropEvents([callback], [remove])

Class: ProgressBar. Method inherited from UIComponent.

Description:

Gets, registers or unregisters a handler function for drop related events. Call without parameters to get an array of already registered handler functions.

Parameters:

Name Type Default Description

[callback]

function

The event handler function that receives a DropEvent object. Pass null to unregister all handler functions.

[remove]

boolean

false

Set to true to unregister the event handler.

Returns:

An array of handler functions if no arguments are passed, otherwise this component for method chaining.

Type: this | Array.<function()>

Examples:

DropEvent object format:

const e = {
  target: object,    // The component that triggered the event.
  type: string,      // `dragenter`, `dragover`, `dragleave`, `drop`.
  action: string     // One of the values of enum DragDropAction. Present when applicable.
  data: object       // An object that contains the data that is being dropped. Present only when e.type is `drop` or `dragenter`.
  source: object,    // A component that is being dragged or dropped onto this component.
                     // Present only when a another UI component is dragged onto this component and `DataType.Component` is of the types set by dragDataType().
  x: number,         // X position of a pointer relative to this component. Present when e.type is `dragstart` or `drop`.
  y: number,         // Y position of a pointer relative to this component. Present when e.type is `dragstart` or `drop`.
  screenX: number,   // X position of a pointer relative to default screen. Present when e.type is `dragstart` or `drop`.
  screenY: number,   // Y position of a pointer relative to default screen. Present when e.type is `dragstart` or `drop`.
  selected: number[] // Array of selected indexes of a List component whose items are being dragged. Present when List items are being dragged.
};

Also See: