ejDroppable

Plugin to make any DOM element Droppable.

Syntax

  • javascript
  • $(element).ejDroppable()

    Example

  • html
  • <div  id="droppable" />
  • javascript
  • <script>
    // Create Draggable
    $('#droppable').ejDroppable();   
    </script>

    Requires

    • module:jQuery

    • module:ej.core

    • module:ej.droppable

    Members

    accept object

    Used to accept the specified draggable items.

    Default Value

    • null

    Example

  • javascript
  • //To set scope API value during initialization  
            $("#droppable").ejDroppable({ accept: null });
  • javascript
  • //Get or set the accept API, after initialization:
            //Gets the accept value  
            $("#droppable").ejDroppable('option', 'accept');

    scope string

    Used to group sets of droppable items, in addition to droppable’s accept option. A draggable with the same scope value as a droppable will be accepted by the droppable.

    Default Value

    • ‘default’

    Example

  • javascript
  • //To set scope API value during initialization  
            $("#droppable").ejDroppable({ scope: 'default' });
  • javascript
  • //Get or set the scope API, after initialization:
            //Gets the scope value  
            $("#droppable").ejDroppable('option', 'scope');

    Methods

    destroy()

    destroy in the Droppable.

    Example

  • html
  • <div  id="droppable"> </div >
  • javascript
  • <script>
    // Create droppableObj
    var droppableObj  = $("#droppable").data("ejDroppable");
    droppableObj.destroy(); 
    </script>

    Events

    drop

    This event is triggered when the mouse up is moved during the dragging.

    Name Type Description
    cancel boolean if the event should be canceled; otherwise, false.
    model object returns the autocomplete model
    type string returns the name of the event
    target object returns the element which accepts the droppable element.

    Example

  • html
  • //drop event for Droppable
    $("#droppable").ejDroppable({ 
            drop: function(args) {}
    });

    out

    This event is triggered when the mouse is moved out.

    </tbody> </table> #### Example
  • html
  • //drop event for Droppable
    $("#droppable").ejDroppable({ 
            out: function(args) {}
    });
    ### over {:#events:over} This event is triggered when the mouse is moved over.
    Name Type Description
    cancel boolean if the event should be canceled; otherwise, false.
    model object returns the autocomplete model
    type string returns the name of the event
    target object returns the mouse out over the element
    Name Type Description
    cancel boolean if the event should be canceled; otherwise, false.
    model object returns the autocomplete model
    type string returns the name of the event
    target object returns the mouse over the element
    #### Example
  • html
  • //drop event for Droppable
    $("#droppable").ejDroppable({ 
            over: function(args) {}
    });