Check documentation for the latest version of dhtmlxSuite onBeforeDrop DHTMLX Docs


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

boolean onBeforeDrop(object context,Event object ev);
contextobjectcontext object
evEvent objectnative HTML event
booleantrue - to trigger the default action, false - to block it


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

  • context.start - ID of an item from which the dragging process started
  • context.source - array of the dragged IDs (drag source)
  • - ID of the target item (drop target)
  • context.from - a list object to which the dragged item belongs
  • - a list object to which the drop target belongs
  • context.index - an index in the target list 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 lists)

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

Back to top