开发者

Dojo when drop[dnd drag drop] it creates a new div

As title, how to make this? I have already done drag and drop using dnd.Source and dnd.Target. Have no idea if it possible to make it when drop and it creates/generates a div whic开发者_开发技巧h it can closable.


I think it would be possible to hook up to the onDndDrop event of your dnd.Target by doing some along these lines:

dojo.connect(yourtarget, "onDndDrop", _dndHandler);

Then in the _dndHandler function you could create a new div using the dojo.create and dojo.place:

var newdiv = dojo.create("div", { innerHTML: "This is my new div" });
dojo.place(newdiv, dojo.byId("your_target_id", "first"));

Hope it helps

/Daniel

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜