How to cancel drop event in YUI drag and drop utility?
We are using a drag and drop utility between one source and multiple targets. We have the limitation that one of the targets can only have one child, and the others can have multiple elements.
I've tried signing the dragdropEvent of the proxy element and returning false in case the destination target has multiple children, without much luck.
var m = new YAHOO.example.DDList("dli" + j, 'documentSelection');
m.subscribe('dragDropEvent', function(e){
if (e.info == 'ulMasterDocument' && $('#ulMasterDocument').children().length > 1){
e.event.canceBubble = true;
return false;
}
return true;
});
Is this code correct? Or do I need to subscribe to another event?
thanks
0
a source to share
1 answer