nestedSortable icon indicating copy to clipboard operation
nestedSortable copied to clipboard

isAllowed returns undefined for placeholderParent when dragging into root

Open Danita opened this issue 9 years ago • 5 comments

When dragging a node into the root, the param placeholderParent of the isAllowed option comes as undefined, and thus it cannot be used to check for business logic (certain items cannot be at root, for example).

isAllowed: function (placeholder, placeholderParent, currentItem) {
    console.log(placeholder, placeholderParent, currentItem);
}

Danita avatar Jul 03 '15 15:07 Danita

@Danita, are you dragging the node from a connected sortable list?

freddyamsterdam avatar Jun 30 '16 22:06 freddyamsterdam

Oh, I reported this a long time ago... I don't really remember. Let me see if I'm still using the library in any of my projects :smile:

Danita avatar Jul 01 '16 00:07 Danita

Yeah, didn't realise until after I commented. 😂

freddyamsterdam avatar Jul 01 '16 03:07 freddyamsterdam

I'm interested with this. I use connected list. I use two times nestedSortable :

  • The 1st to manage category and subcategory on 2 levels (not connected)

  • The 2nd to manage item (in these categories/subcategories), connected with css class on 1 level.

What I want is to drag item from a category/subcategory to another without be able to drop it in the root of the categories.

Dropping item in another category/subcategory is working but I can't prevent dropping in root of the categories.

Do you know how to do that ?

LrntL avatar Aug 07 '19 07:08 LrntL

Ok. For you interest, take a look at this fork (in development) : https://github.com/CanopyApps/nestedSortable/tree/develop

It has "maintainNestingLevel" option when set to true does what I need. Do you how to achieve this in our case ?

LrntL avatar Aug 07 '19 08:08 LrntL