Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config option to confine list items to stay within their own hierarchy level? #54

Open
amfriedman opened this issue Jan 26, 2017 · 5 comments

Comments

@amfriedman
Copy link

Is there an option to ensure that once you start dragging any list item, nestable does not allow the item to be moved across the hierarchy but only among items on its own level?

@pjona
Copy link
Collaborator

pjona commented Jun 22, 2017

There is no functionality like this, but we are open for PR.

@RomanBurunkov
Copy link
Contributor

This can be done with beforeDragStop callback.

e.g.
You can add data-type to parent list items and to children.
And mach parent and child type at callback.

@rwx666888
Copy link

Can join such a control, control in the same level of mobile is sometimes useful, at present beforeDragStop + .dd-nochildren There is a problem at the root level, can not effectively handle,
https://github.com/dbushell/Nestable/pull/194/files

@aximuseng
Copy link

I know this a stale repo but figured I would ask. I have this functionality as suggested by @RomanBurunkov. The issue that remains is that the placeholder doesn't get added. It seems that gets blocked by the callback. There is no user feedback where you are dropping items etc. I am also thinking it's possible to make that placeholder CSS conditional i.e. red for places you can't drop etc. which would be a nice touch. Any suggestions where to start here - been digging through the source code but it's not obvious.

@aximuseng
Copy link

I had a rouge dd-nochildren in my DOM which caused this. It seems that you can't dynamically change the dd-placeholder class from these callbacks as you move the selection around (desired). Trying to figure out in the source code where I can perhaps add this functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants