gridstack - v14.1.0-dev
    Preparing search index...

    Class DDDraggable

    Interface for HTML elements extended with drag & drop options. Used to associate DD configuration with DOM elements.

    Hierarchy (View Summary)

    Implements

    Index

    Accessors

    • get disabled(): undefined | boolean

      Returns the current disabled state (undefined if not set yet). Note: Use enable()/disable() methods to change state as other operations need to happen.

      Returns undefined | boolean

    Constructors

    Methods

    • Which grid (or trash) we're over goes by how much of the item is over it rather than where the cursor is, which depends on where the item was grabbed (and can't get it above/below a sub-grid flush with its parent's edge, as both share that edge). Go into the innermost one under the item's center once enough of it is over it (DDDroppable.enterOver - more for a sub-grid, so coming in at the edge of a nest we go into its outer grid first, as we come out of it), and out once not enough is (stayOver) to the closest outer grid still having enough of it. Going to a neighbor instead takes clearly more of it over that one than ours (switchBy).

      Parameters

      • e: MouseEvent

      Returns void

    • Destroy this drag & drop implementation and clean up resources. Removes all event handlers and clears internal state.

      Returns void

    • Disable this drag & drop implementation. Subclasses should override to perform additional cleanup.

      Parameters

      • forDestroy: boolean = false

      Returns void

    • return all handles omitting other nested .grid-stack-item children (in case node.subGrid isn't set for some reason)

      Returns HTMLElement[]

    • Unregister an event callback for the specified event.

      Parameters

      • event: DDDragEvent

        Event name to stop listening for

      Returns void

    • Register an event callback for the specified event.

      Parameters

      • event: DDDragEvent

        Event name to listen for

      • callback: (event: MouseEvent) => void

        Function to call when event occurs

      Returns void

    • Re-scans the item element for drag-handle elements after delayed content (React portal, Angular component, etc.) has been rendered into the item. Removes listeners from the previous handle set, re-queries, then re-attaches. Not needed for the default .grid-stack-item-content handle which is always present.

      Returns void

    • Trigger a registered event callback if one exists and the implementation is enabled.

      Parameters

      • eventName: string

        Name of the event to trigger

      • event: Event

        DOM event object to pass to the callback

      Returns boolean | void

      Result from the callback function, if any

    Properties

    _autoScrollContainer?: HTMLElement
    _autoScrollMaxSpeed?: number
    autoScrollBandMin: number = 30

    The HTML element being extended

    option: DDDragOpt = {}

    The drag & drop options/configuration