Loading ...
Sorry, an error occurred while loading the content.

Re: TreeView: passing node object with regular href property?

Expand Messages
  • groovepapa82
    ... I found the answer to my own question, and in fact, the TreeView uses it by default... Simply, build up the href as a javascript call to my function, but
    Message 1 of 2 , Mar 23 7:03 AM
    • 0 Attachment
      > I thought to add an 'href' property to and object to pass to the
      > TextNode constructor, but how can I pass the node object using href?

      I found the answer to my own question, and in fact, the TreeView uses
      it by default...

      Simply, build up the href as a javascript call to my function, but the
      arguments I pass are not values, but rather calls to the YAHOO
      function for getting the node I want...

      var thisNodeJSCode =
      "YAHOO.widget.TreeView.getTree('nav').getNodeByProperty('id','"+catID+"')";
      var href = "javascript:gotoNode("+thisNodeJSCode+");";
      var category = {label: label, id: catID, path: path, href: href};

      > But I'd like to just call the single gotoNode function if possible, so
      > if I change the gotoNode behavior later, I don't have to change it in
      > the different places.

      So the single gotoNode function and its behavior is accomplished by
      the above, passing the entire node object to the gotoNode function.
    Your message has been successfully submitted and would be delivered to recipients shortly.