1

I'm trying to deselect the current node in a dynatree.

node.deactivate(); // doesn't work
node.focus(false); // doesn't exist

I tried to remove the classes that highlight the focused/activated node :

This worked but destroy the complete CSS of the tree :

$("#tree span").removeClass(); 

But this did NOT work, and I checked carefully the class names :

$("#tree span").removeClass("dynatree-active dynatree-focused"); 

Question is : how to deselect an active node, at least by removing the visual highlight ? Thx

Stéphane V
  • 1,094
  • 2
  • 11
  • 25
  • I've just tried deactivate() and it worked for me. I had a button that when clicked did the following: var node = $("#tree").dynatree("getActiveNode"); node.deactivate(); – Gruff Bunny Dec 30 '13 at 13:46

1 Answers1

1

deactivate() doesn't work for me, I give you my alternative solution:

$("#tree").dynatree("getRoot").visit(function(node){
   node.select(false);
});
Darek Kay
  • 15,827
  • 7
  • 64
  • 61
cvasquem
  • 26
  • 1