-
Notifications
You must be signed in to change notification settings - Fork 21
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
Using getNodeParentByPath for a dragged node #20
Comments
If dragNode not be dropped, its path is store.startPath, else store.targetPath. getNodeParentByPath(store.startPath)
getNodeParentByPath(store.targetPath) But in current version <Tree ref="tree" @change="handleTreeChange"> handleTreeChange () {
const store = this.$refs.tree.treesStore.store
const {dragNode} = store
// get the parent of dragNode
getNodeParentByPath(store.startPath)
getNodeParentByPath(store.targetPath)
} |
Now v2 pulished. You can use getNodeParentByPath(store.startPath)
getNodeParentByPath(store.targetPath) |
Thanks! I will use it now |
I get this error [Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'store' of undefined" |
@bajki could you show more? |
https://codesandbox.io/s/quirky-diffie-ssrrm Could you update this to show us how it works? Because i need parent_id to update sql |
@bajki |
Hi! |
try both
If dragNode not be dropped, its path is store.startPath, else store.targetPath. |
I've tried both variants But the path on drop is incorrect because I move the node from top to bottom |
@AlexKonovalik Could you create a reproduce on codepen or other sites? |
@phphe Shure! IMHO, the problem is not even in STR:
Actual result:
Expected result:
|
@AlexKonovalik use he-tree-vue@3.1.0 |
@phphe Thanks! It works correctly in this version |
Hi,
I am working with a Draggable plugin.
How can I access the parent of the dragged node?
I see
getNodeParentByPath
method, but how do I call it?Thank you
The text was updated successfully, but these errors were encountered: