Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Kind'a shooting a blank i guess, there are a few different implementations of the dndSource. But there are a some things one needs to know about the events / checkfunctions that are called during the mouseover / dnddrop.</p> <p>One approach would be to setup <code>checkAcceptance(source, nodes)</code> for any target you may have. Then keep a reference of the nodes currently dragged. Gets tricky though, with multiple containers that has dynamic contents.</p> <p>Setup your Source, whilst overriding the <code>checkAcceptance</code> and use a known, (perhaps global) variable to keep track.</p> <pre><code>var lastReference = null; var target = dojo.dnd.Source(node, { checkAcceptance(source, nodes) : function() { // this is called when 'nodes' are attempted dropped - on mouseover lastReference = source.getItem(nodes[0].id) // returning boolean here will either green-light or deny your drop // use fallback (default) behavior like so: return this.inhertied(arguments); } }); </code></pre> <p>Best approach might just be like this - you get both target and source plus nodes at hand, however you need to find out which is the right stack to look for the node in. I believe it is published at same time as the event (<code>onDrop</code>) youre allready using:</p> <pre><code>dojo.subscribe("/dnd/drop", function(source, nodes, copy, target) { // figure out your source container id and target dropzone id // do stuff with nodes var itemId = nodes[0].id } </code></pre> <p>Available mechanics/topics through dojo.subscribe and events are listed here <a href="http://dojotoolkit.org/reference-guide/1.7/dojo/dnd.html#manager" rel="nofollow">http://dojotoolkit.org/reference-guide/1.7/dojo/dnd.html#manager</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload