Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dojo.dnd one item at a time only

Using dojo.dnd, I want to allow a user to drag only one item at a time, rather than any arbitrary number, as per the dojo's default behaviour.

At the moment, a user can hold Ctrl and click multiple draggable items at a time, then drag them all as a group. I want to disable this so that the user can only drag one item at any given time.

I'm using a dojo.dnd.Source(), as below.

new dojo.dnd.Source(containerNode)

...which makes all of the child nodes of containerNode draggable.

Thanks.

like image 315
Jez Avatar asked Oct 21 '09 13:10

Jez


1 Answers

You need to set "singular" property of your dojo.dnd.Source (which is inherited from dojo.dnd.Selector):

        new dojo.dnd.Source(containerNode, { singular: true } );
like image 148
ivalkeen Avatar answered Oct 22 '22 13:10

ivalkeen