Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature Request: Adding the method of FancyTreeNode.getSelectedNodes() #542

Closed
yasemindeki opened this issue Jan 8, 2016 · 1 comment
Closed

Comments

@yasemindeki
Copy link

Hi, firstly thank you so much for this great library. I hope this request will be evaluated.

We need to get the selected nodes under the specific node(FancyTreeNode instance). I know that the only way to get the selected nodes is to use the method of FancyTree.getSelectedNodes over all tree. If there is another way I don't know sorry about that. For now we implemented this requirement as below but I think adding the method of FancyTreeNode.getSelectedNodes() would be better.

    getSelectedNodes: function (key) {
        var fancyTreeNode =  $(this.domElementId).fancytree("getTree").getNodeByKey(key);
        var selectedNodes = [];
        fancyTreeNode.visit(function (childNode) {
            if (childNode.isSelected()) {
                selectedNodes.push(childNode);
            }
        });

        return selectedNodes;
    }

Best regards,

@mar10
Copy link
Owner

mar10 commented Jan 9, 2016

Will do, thanks.

@mar10 mar10 closed this as completed in 801d15f Jan 10, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants