István István - 4 months ago 32
jQuery Question

How to set value of jQuery TreeSelect programatically

How do I set the value of jQuery TreeSelect from JavaScript when it is populated? Is there something like

$('#treeId').treeSelect('setValue', 3)
? I cannot find in the docs included.

B A B A
Answer

Since treeSelect is using fancytree, you can use this command:

$('#fancytree_container').fancytree('getTree').getNodeByKey(key).toggleSelected();
Comments