views:

330

answers:

1

I have a dojo.dnd Source object that I just want to list out normally, without the user being able to sort the objects. Is this possible?

+2  A: 

You should use selfAccept="false" (and probably copyOnly="true") too in your Source declaration. That will prevent the user from re-ordering your list.

If you want to prevent items from getting dragged into it, just set the accepts parameter to something that you don't have.

You can see an example of it on dojotoolkit. Just do a search for selfAccept

seth
I'm using dojo.dnd.Source to display a list of draggable items, and dojo.dnd.Target as a droppable area which accepts items from the Source objects. In the Source list, however, I don't want users to be able to move the items around, they should only be able to drag the item out and drop it into the Target object. I didn't see any properties for Source that seem to disable sorting...any ideas? Thanks for your help for the other question too, btw.
Calvin L
ok, updated the answer. Hope it helps.
seth
Perfect! Thank you! I don't know why I didn't think about selfAccept. The API documentation is a bit sparse, dontcha think?
Calvin L
Yeah, it's pretty spotty in parts. I tend to look at the tests directory and/or docs.dojocampus when I need information. Failing that I go to the source.
seth