1

I am trying to deselect the single selected node in dynatree on a button click. Here is my code :

$(function() {
    $('#btnViewAll').on('click', function(e) {
        $('#contents>div').show();
        $("#tree").dynatree("getRoot").visit(function(node){
            node.select(false);
        });
    });
});

This code goes through all the nodes but never deselects any anything. What am I missing?

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101
nlstack01
  • 789
  • 2
  • 7
  • 30

1 Answers1

1

You could use the alternative deactivate() :

$("#tree").dynatree("getRoot").visit(function(node){
     node.deactivate();
});

Hope this helps.

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101