Check documentation for the latest version of dhtmlxSuite onBeforeDrop DHTMLX Docs

onBeforeDrop

fires before an item is dragged to another target and the mouse button is released

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

Parameters

contextobjectcontext object
evEvent objectnative HTML event

Returns

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

Example

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

Details
  • context.start - ID of an item from which the dragging process started
  • context.source - array of the dragged IDs (drag source)
  • context.target - ID of the target item (drop target)
  • context.from - a view object to which the dragged item belongs
  • context.to - a view object to which the drop target belongs
  • context.index - an index in the target view at which a new item will be added
  • context.new_id - an id which will be used for the moved item (actual only while moving between different views)

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

Back to top