I’m using Dojo trying to build an application with dojo’s dnd. I’ve looked around for an answer to this problem but I’m just not sure how to accomplish this. I have a Source object in which there are a bunch of products formatted with html/css in a certain way. When I drag these objects to my Target object, the dropped item still looks the same as before. I want to format it differently after being dropped. Any ideas how to do this?
I’m using Dojo trying to build an application with dojo’s dnd. I’ve looked around
Share
You do this via passing a
creatorfunction ref to your Source object.Assuming you have dojo 1.3 and can use
dojo.create.In your JS:
Then in your HTML (div or whatever):
If you want to create the
Sourceitem programmatically, just pass in the creator like so:I used
item.namein my example above. This all depends on your item though so you will probably want to use a different field.An excellent walk through of creating a
dojo.dndpage is on the SitePen blog.