Documentation

addDrop

registers drop area

void addDrop(id|HTMLElement node,object ctrl,boolean master_mode);

Parameters

nodeid|HTMLElementhtml node or ID
ctrlobjecthash 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

See also

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;
                    }
                }
});

Details

In the code above, only UI components can be dragged (non-ui and DataValue, DataRecord and DataCollection).In addition, if several items from the source datatable are dragged, only the first one reached the taget textarea.

Back to top