Check documentation for the latest version of dhtmlxSuite onBeforeDrag DHTMLX Docs

onBeforeDrag

fires before the drag operation started

boolean onBeforeDrag(object context,Event object ev){ ... };

Parameters

contextobjectcontext object
evEvent objectnative event object

Returns

booleantrue - to trigger the default action, false - to block it

Example

myList.attachEvent("onBeforeDrag", function (context, ev){
    // your code here
    return true;
});

Details

possible context object values:

  • context.start - ID of an item from which the dragging process started;
  • context.source - array of the dragged IDs (drag source);
  • context.html - this property can be set to redefine the content of the drag-marker;
  • context.from - an object to which the dragged item belongs.

The event is blockable, returning false will block the default action.

Back to top