the dojo book mentioned how to programmatically build whole dnd widget. but I only want to programmatically insert a dnd item(just a IMG node) into an existed dojo.dnd.Source. I tried appendChild() method and .className property but it didn't work for drag and drop function.
can anyone give me a suggestion?
thanks
Andre

If you use 1.2.2 or later,
If you use 1.2.2 or later, you can add a node (with all proper classes) and call sync() method on the source to learn about new nodes. If you working with custom creators, you should just use insertNodes().
Using sync() can be taxing if you have a lot of DnD items to sync, like hundreds, but it should be OK for small numbers.
to some reason...
I'm using version 1.1.0 and I can only use this version. But I will try out your suggestion.
thanks any way.
-Andre
Most probably sync() is not
Most probably sync() is not in this version, but read the documentation and use insertNodes() — it is guaranteed to work.
I think insertNodes() is the
I think insertNodes() is the right way to do this.
I should read API and search through the forum first.
see also
http://www.dojotoolkit.org/forum/dojo-core-dojo-0-9/dojo-core-support/dr...