Comments (8)
ondragend: {type: Function}, // hook. return false to prevent drop. arguments(node, draggableHelperInfo)
node._vm.store.dplh // placeholder
node._vm.store.dplh.parent
node._vm.store.dplh.parent.text
node.text
from vue-draggable-nested-tree.
I see. But how do I get the info of the target node, underneath of which another node is to be placed at? I don't see any variable called targetNode in the node. I want to forbid dropping underneath of a node, not as a child node.
from vue-draggable-nested-tree.
the placeholder will be replaced after drop, so think placeholder(dplh) as target node.
from vue-draggable-nested-tree.
I mean, I need to get the information of the previousSibling, if I I were to drop a node at a new location. dplh is just the placeholder and doesn't contain any information about the text of the previous node.
from vue-draggable-nested-tree.
// previousSibling
index = dplh.parent.children.indexOf(dplh)
dplh.parent.children[index-1]
from vue-draggable-nested-tree.
Oh I did the same thing. Thanks for your help!
from vue-draggable-nested-tree.
Oh one other question. Is it possible to prevent dropping of a tree node from another tree underneath a certain tree node ? Because the ondragend function is only called when the dragged tree node comes from the same tree. If it comes come from another tree, only ondrop function is called. Returning false here does not forbid dropping. And my trees need to crossTree.
from vue-draggable-nested-tree.
oh don't mind that question earlier. I have solved the problem.
from vue-draggable-nested-tree.
Related Issues (20)
- Scroll when dragging nodes at edges HOT 4
- click to get data is not showing all data HOT 1
- Drag ghosts are hidden behind other components when dragging HOT 1
- update data does not update the tree view HOT 2
- Collapse all trees when dragging HOT 1
- 多选情况下的拖拽功能 HOT 1
- Uncaught ReferenceError: regeneratorRuntime is not defined HOT 8
- 'nodeOpenChanged' events cannot be listened
- Get Index or path ? HOT 1
- manual update call to force the tree to refresh HOT 5
- not working drag.. HOT 3
- "TypeError: Cannot read property '_vm' of undefined" HOT 4
- Disable nesting for specific tree HOT 4
- not compatible with corejs@3 ? HOT 7
- how to use `store.pure`another button HOT 2
- Does this support multiple select? Can we select multiple elements and drag-drop? HOT 5
- Helper.js triggering CSP for inline style HOT 2
- Make only parent undraggable HOT 1
- Find replaced node HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-draggable-nested-tree.