a5hik / ng-sortable

AngularJS Library for Drag and Drop, supports Sortable and Draggable. Supports Touch devices.

Home Page:http://a5hik.github.io/ng-sortable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Restrict Drop on a specific area.

prakriti-patra opened this issue · comments

Hi, my problem is as below.

I have 2 divs - DivA and DivB. Both of these have elements that are draggable and droppable and are working fine. But I am unable to restrict the drop on each other. To be more precise, I don't want elements of DivA to be dropped on DivB and vice versa.

I read in your github page that it is possible to do this. But I couldn't find the documentation about it. Could you please help me.

Thank you.

In the dragControlListeners, you can specify the containment variable which works as a jQuery selector. Simply have two sets of listener, one for divA, one for divB, each with their own containment variable.