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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Position Within Level #30

Closed
fulopattila122 opened this issue Sep 24, 2018 · 2 comments
Closed

Node Position Within Level #30

fulopattila122 opened this issue Sep 24, 2018 · 2 comments

Comments

@fulopattila122
Copy link

fulopattila122 commented Sep 24, 2018

First of all: cool component! 馃憤

How can I obtain the position of a node within a level?

Example:
I have 3 nodes: "Orange", "Banana" and "Kiwi" - all on the root level.
I drag the Banana node to the first position; just before Orange.
So the new order of the nodes will be "Banana", "Orange, "Kiwi".
Using the @change handler, how can I obtain if Banana became the first node?

Thank you!

@phphe
Copy link
Owner

phphe commented Sep 26, 2018

do you mean node index? node.parent.children.indexOf(node)

@fulopattila122
Copy link
Author

Yes, thanks!

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

2 participants