Code Monkey home page Code Monkey logo

Comments (8)

phphe avatar phphe commented on June 13, 2024
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.

dini-m avatar dini-m commented on June 13, 2024

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.

phphe avatar phphe commented on June 13, 2024

the placeholder will be replaced after drop, so think placeholder(dplh) as target node.

from vue-draggable-nested-tree.

dini-m avatar dini-m commented on June 13, 2024

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.

phphe avatar phphe commented on June 13, 2024
// previousSibling
index = dplh.parent.children.indexOf(dplh)
dplh.parent.children[index-1] 

from vue-draggable-nested-tree.

dini-m avatar dini-m commented on June 13, 2024

Oh I did the same thing. Thanks for your help!

from vue-draggable-nested-tree.

dini-m avatar dini-m commented on June 13, 2024

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.

dini-m avatar dini-m commented on June 13, 2024

oh don't mind that question earlier. I have solved the problem.

from vue-draggable-nested-tree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.