Reputation: 1487
I have a lazy loading tree which all works fine, however I need to be able to expand a particular node in jQuery. I've looked at the demo here but I whenever I try to call toggleExpand()
I get the following error (on IE9 which is the target platform on our intranet):
"0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'toggleExpand'"
My code is simply:
var node = $("#OrgDataTree").fancytree("getTree").getNodeByKey(key);
node.toggleExpand();
alert(node.key); // testing for node, I see what I expect.
Using node.expand()
gives the same result. I've also tried grabbing the node from the activate(event, data)
event as data.node
but it also doesn't work for me (not that this is the case I need to use, I'm just trying to find some way of getting a handle to the node object that works).
It seems as though this should do what I need, according to any documentation I find, but it doesn't.
Upvotes: 1
Views: 5974
Reputation: 14794
Looks like you are using the old method names from Dynatree. Fancytree uses 'toggleExpanded()' and 'setExpanded()' instead. See also http://wwwendt.de/tech/fancytree/doc/jsdoc/FancytreeNode.html
Upvotes: 6