Note that there are some explanatory texts on larger screens.

plurals
  1. POHelp with Dojo Drag & Drop
    primarykey
    data
    text
    <p>Hi I am trying to implement some drag and drop functionality into a project but am having a bit of difficulty with a few aspects. One of the problems I am having is with the creation of a custom avatar, I am able to achieve a custom avatar but have to cheat slightly and hide some elements with CSS.</p> <p>Below is a <strong>snippet</strong> of my code not the entire code, I have required all necessary pacakges etc.</p> <pre><code>dojo.query(".canDrag").forEach(function(node, index, nodelist){ var createSource = new dojo.dnd.Source( node, {copyOnly: true, creator: createAvatar} ); function createAvatar(item, hint) { var node = dojo.doc.createElement("span"); dojo.addClass(node, "avatarStyle"); if ( hint == "avatar" ) { var dHtml = item; console.log("trying " + dHtml); node.innerHTML = item; } else { console.log("if this show remove redudant call"); } return {node: node, data: item, type: "product", copyOnly: true}; }; </code></pre> <p>Ok so as you can see I create my DnD source then give it a custom creator where I attempt to build my own custom Avatar. The actyual draggable markup is below:</p> <pre><code>&lt;div class="canDrag panelLeft"&gt; &lt;div class="dojoDndItem" dndType="product" title="digitalCamera" id="12345"&gt; &lt;h3 class="productTitle"&gt;&lt;a href=""&gt;Samsung ES71&lt;/a&gt;&lt;/h3&gt; &lt;p class="productType"&gt;Compact Digital Camera&lt;/p&gt; &lt;img src="img/small_Cam.png" class="imgLMargin" alt="Samsung ES71"/&gt; &lt;div class="dragHandle"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Rather than append the entire div from canDrag and down I would like to grab different elements such as the image and .product title and just display those. If any one has any ideas I thank you in advance also if my question has not been clear enough I can try to rephrase. </p> <p>Cheers </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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