onBeforeDrag

fires before the mouse button is pressed and the cursor is moved over a draggable item

boolean onBeforeDrag(object context,Event native_event);
context
objectthe drag-n-drop context native_event
Eventan HTML event object
booleanreturning false will prevent dragging of the element

Example

grida.attachEvent("onBeforeDrag", function(context, native_event){
    context.html = "<div style='padding:8px;'>";
    for (var i=0; i< context.source.length; i++){
        context.html += context.from.getItem(context.source[i]).title + "<br>" ;
    }
    context.html += "</div>";
    return true;
});

Related samples

Details

If you drag multiple items, the event will be called once for the entire batch of items.

The drag-and-drop context can have the following properties:

See also
  • API
  • Articles
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.
    If you have not checked yet, be sure to visit site of our main product Webix javascript dashboard framework and page of javascript tree view product.