onListBeforeDrag

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

boolean onListBeforeDrag(object context,Event ev,object list);
contextobjectdrag-n-drop context object with a set of properties (see details)
evEventa native event object
listobjectthe list object where the event has happened
booleanreturning false will prevent dragging of the element

Example

$$("myBoard").attachEvent("onListBeforeDrag", function(context,ev,list){
    if(...){
        return false;
    }
    return true;
});

Related samples

Details

The properties of the context object are:

  • from - the source object
  • to - the target object
  • source - the ID of the dragged item(s)
  • target - the ID of the drop target, null for drop on empty space
  • start - the ID from which drag-n-drop started
  • index - the index of the item in the column
  • x_offset - the left offset between the pointer and the dragged list
  • y_offset - the top offset between the pointer and the dragged list
Back to top
If you have not checked yet, be sure to visit site of our main product Webix js framework and page of javascript library list product.