0
我已經設置了一個左面板(源代碼)和右面板(源代碼爲& target)的小界面。Make dojo.dnd.Source out of dragulated/copied item
從左側面板拖動/複製到右側面板,並在刪除時創建新的div。
我現在希望能夠將項目放入新的div,即新的div也應該是源。
但是我不知道如何做到這一點,你能幫忙嗎?
HTML
<div id="left-panel">
<div class="dojoDndItem">Div</div>
</div>
<div id="right-panel">
</div>
JS
//This is a creator to be run when an item is dropped onto the right panel
function myCreator(item, hint) {
if (item == 'Div') {
var myNode = dojo.create('div');
}
//This is how I create the sources
var leftPanel = new Source("left-panel", { copyOnly:true });
var rightPanel = new Source("right-panel", { accept:[ "div", "button", "image" ], creator:myCreator });
}