2

I am using fancytree to render a directory, and when the user selects a node in the fancytree, I want to deactivate it. I've been searching through the apis and came across setActive(false) which I thought would do the trick. But it doesn't work. In fact, the user can still select the node, expand, etc...

node.setActive() // not working

Does anyone the correct way to disable a node in fancytree?

dr.jekyllandme
  • 613
  • 2
  • 11
  • 22

1 Answers1

2

In Fancytree there is one (or no) node active. A node may become active when clicked by the user, using keyboard, or using the setActive() API.

See here for an overview of different statuses: https://github.com/mar10/fancytree/wiki/FAQ

This has nothing to do with a 'disabled' property. There is no API to support that directly, but you could return false in the 'click', 'expand', ... event handlers to prevent default behavior.

mar10
  • 14,320
  • 5
  • 39
  • 64