nestedSortable
nestedSortable copied to clipboard
isAllowed returns undefined for placeholderParent when dragging into root
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, are you dragging the node from a connected sortable list?
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:
Yeah, didn't realise until after I commented. 😂
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 ?
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 ?