2

I would like to disable dragging between two lists in jQuery nestable plugin.

There is an option group in documentation https://github.com/RamonSmit/Nestable

group group ID to allow dragging between lists (default 0)

So I change that to element id

$('.dd').nestable({
    maxDepth: 1,
    group: $(this).attr('id')
});

But it's not working. User can drag and drop items between two nestables as he wants.

Manic Depression
  • 1,000
  • 2
  • 16
  • 34

1 Answers1

4

In your current code, this refers to the parent scope, somethings like window or document, not .dd.

You have to call nestable for each list, try this:

$('.dd').each(function(){
    $(this).nestable({
        maxDepth: 1,
        group: $(this).prop('id')
    });
});