addDrop

registers drop area

void addDrop(id|HTMLElement node,object ctrl, [boolean master_mode] );
nodeid|HTMLElementhtml node or ID
ctrlobjectobject code of the drag control methods
master_modebooleanflag which can be used if node in question has multiple inner areas, some of them can be used in DND and some not

Example

webix.DragControl.addDrop("myDrop",{
    $drop:function(source, target){
        var dnd = webix.DragControl.getContext();
        if (dnd.from.name){ //ignoring non-ui dnd
            // setting which value to drop if case of multiselect 
            var value = dnd.from.getItem(dnd.source[0]).title; 
            target.innerHTML=value;
        }
    }
});

Related samples

See also
Back to top