2

http://wwwendt.de/tech/dynatree/index.html

Is it possible to disable individual nodes? If so, how?

Aman Jain
  • 655
  • 5
  • 17
sarsnake
  • 26,667
  • 58
  • 180
  • 286

3 Answers3

3

Currently there's only the 'unselectable' node attribute. A workaround could be to let the onQueryActivate callback return false. And maybe add a custom class using the 'addClass' node option, to change the visual appearance.

http://code.google.com/p/dynatree/issues/detail?id=68

mar10
  • 14,320
  • 5
  • 39
  • 64
3
$("#tree").dynatree({
        […]
        onActivate: function(node) {

          node.data.unselectable = true; //make it unselectable
          node.data.hideCheckbox = true; //hide the checkbox (more for UI purposes)

          node.render(true);


        },
        […]
    });

would disable the node on the fly

sarsnake
  • 26,667
  • 58
  • 180
  • 286
1

You can also use the unselectable and hidecheckbox properties directly while creating the dynatree node.

This was exactly what I needed, I wanted to have certain parent items unselectable in the tree.

Thanks,

Rudy

Rudy Gerla
  • 11
  • 2