onBeforeDrag
fires before the mouse button is pressed and the cursor is moved over a draggable item
function onBeforeDrag( // the drag-n-drop context context: object, // an HTML event object native_event: Event): boolean
Returns
Section titled “Returns”boolean
returning false will prevent dragging of the element
Example
Section titled “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;});
also check the next samples:
Details
Section titled “Details”The drag-and-drop context can have the following properties:
- 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 dropping on empty space
- start - the ID from which drag-n-drop was started
See also
Section titled “See also”Articles
API