0

I have two divs, one Draggable and one Sortable.

I'd like to keep the values in the sortable unique: I don't want any item that is already in the draggable to be able to be dropped again in the sortable.

I tried to use cancel() but it doesn't seem to be working.

http://jsfiddle.net/6DSaV/2/ shows that I can't even get cancel to do anything.

you786
  • 3,659
  • 5
  • 48
  • 74

1 Answers1

0

if you change the tag in the sortable div for a DIV and not a P. The event cancel() works.

<div id='sortable'>
    <div>Drag stuff here.</div>
</div>

<div id='draggable'>
    <div data-id='1'>One</div>
    <div data-id='2'>Two</div>
</div>
manuerumx
  • 1,230
  • 14
  • 28
  • Well, if I do that, the items don't go where you drop them. But it still allows you to add items. I'm trying to stop the addition of items in the sortable. Check out my updated jsfiddle. – you786 Oct 18 '12 at 20:03
  • The only solution i found is setting the helper option to "original" but the draggable option disappear from the list. :( – manuerumx Oct 18 '12 at 21:23