John Smith
John Smith

Reputation: 1280

Jquery fancytree. How to iterate over all siblings and get custom attributes of each?

I use sorting plugin. When I move element1 to some other element2, I need to iterate over all siblings of element2. How can I do that? Moreover, I need to get some custom data- attribute for each element.

Upvotes: 1

Views: 1508

Answers (1)

mar10
mar10

Reputation: 14794

Something like this (untested) should do the trick:

node.getParent().visit(function(n){
    // Access n.data.myAttr ...
});

or simply iterate over the node.getParent().children array.

Upvotes: 2

Related Questions