Skip to main content

Home > @jsplumbtoolkit/drop > SurfaceDropManagerOptions

SurfaceDropManagerOptions interface#

Options for the SurfaceDropManager.

Signature:

export interface SurfaceDropManagerOptions<T> 

Properties#

PropertyTypeDescription
allowDropOnCanvas?boolean(Optional) Defaults to true. Allows items to be dropped onto whitespace.
allowDropOnEdge?boolean(Optional) Defaults to true. Allows items to be dropped onto edges in the canvas.
allowDropOnGroup?boolean(Optional) Defaults to true. Allows items to be dropped onto groups in the canvas.
allowDropOnNode?boolean(Optional) Defaults to false. Allows items to be dropped onto nodes in the canvas. If this is true and an element is dropped onto a node, the result is the same as if the element has been dropped onto whitespace.
canvasSelector?string(Optional) Optional selector specifying what parts of the surface's canvas should be considered whitespace. If you're using a decorator, for instance, you might want to add a selector for that decorator's elements so that items can be dropped onto them.
dataGenerator?DataGeneratorFunction<T>(Optional) Optional function to generate an initial payload from an element that has started to be dragged.
groupIdentifier?GroupIdentifierFunction<T>(Optional) Optional function to use to determine if the element being dragged represents a group. If you do not provide this, the default behaviour is to check for the presence of a data-jtk-is-group attribute on the element, with a value of true.
ignoreGrid?boolean(Optional) Defaults to false. By default this class will conform to any grid in place in the surface to which it is attached when dragging items around.
magnetize?boolean(Optional) If true, the surface will be instructed to magnetize after dropping a new element.
selectorstringA CSS selector identifying children of source that are draggable
sourceElementThe element containing things that will be dragged.
surfaceSurfaceThe surface to attach to.
typeGenerator?TypeGeneratorFunction<T>(Optional) Optional function to determine the type of the data object being dragged from an element that has started to be dragged.