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

Allow parent change on items that are not parents? #136

Open
jaradc opened this issue Oct 25, 2021 · 0 comments
Open

Allow parent change on items that are not parents? #136

jaradc opened this issue Oct 25, 2021 · 0 comments

Comments

@jaradc
Copy link

jaradc commented Oct 25, 2021

Long time admirer of this amazing jQuery work of art. It's just amazing! Genius really.

Quick question for anyone: See below? The top item 0 is the root node. The rest are all parent items.
I'd like to allow child items to move freely between parent items, but not let parent items with depth of 1 be moved into another parent.

disableParentChange: true disables parents moving under another parent, yes. But, it doesn't allow for children to move from one parent to another.

0: {item_id: null, parent_id: null, depth: 0, left: 1, right: 16}
1: {item_id: '1', parent_id: null, depth: 1, left: 2, right: 3}
2: {item_id: '3', parent_id: null, depth: 1, left: 4, right: 5}
3: {item_id: '2', parent_id: null, depth: 1, left: 6, right: 7}
4: {item_id: '4', parent_id: null, depth: 1, left: 8, right: 9}
5: {item_id: '5', parent_id: null, depth: 1, left: 10, right: 11}
6: {item_id: '6', parent_id: null, depth: 1, left: 12, right: 13}
7: {item_id: '7', parent_id: null, depth: 1, left: 14, right: 15}
length: 8

How would I use the isAllowed function to say "If item has depth equal to 1, don't allow the move/drop.?

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

No branches or pull requests

1 participant