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

Preventing the jqTree UI from displaying the option to drop INTO a node for some nodes #598

Closed
passthechickenstrips opened this issue May 29, 2020 · 2 comments

Comments

@passthechickenstrips
Copy link

Stackoverflow question: https://stackoverflow.com/questions/62089356/preventing-the-jqtree-ui-from-displaying-the-option-to-drop-into-node-for-some-n

I have the following:

    $('#sidebar-tree').tree({
        data: data,
        autoOpen: false,
        dragAndDrop: true,
        selectable: false,
        closedIcon: $('<i class="fas fa-angle-up"></i>'),
        openedIcon: $('<i class="fas fa-angle-down"></i>')
    })

Though for some nodes, I'd like to allow the user to reorder them (so dragging the node between nodes is cool) but I want to prevent the user from dropping them into other nodes. Is there a way to configure this "permitted behavior" per node?

@mbraak
Copy link
Owner

mbraak commented May 30, 2020

I added an answer to the stackoverflow question. Short answer: use the onCanMoveTo option.

@passthechickenstrips
Copy link
Author

Thank you very, very much for the quick response and amazing library.

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