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

Re: [ydn-javascript] Save treeview state in cookie

Expand Messages
  • Eric Miraglia
    Peter, The TreeView does incorporate an API that can notify you when a node is expanded. Check out TreeView s methods listed on the API page for a full list,
    Message 1 of 3 , Feb 14, 2006
    • 0 Attachment
      Peter,

      The TreeView does incorporate an API that can notify you when a node is expanded.  Check out TreeView's methods listed on the API page for a full list, but onExpand is the method you want here; TreeView will fire that method for you every time a node is expanded, passing the expanding node in as an argument.  Note that you'll also want to track collapse events as well, using the onCollapse method.

      var tree;
      function treeInit() {
      tree = new YAHOO.widget.TreeView("treeDiv1");
      tree.onExpand = function(node) {
      //set cookie information here
      }
      tree.onCollapse = function(node) {
      //set cookie information here
      }
      // add nodes here
      tree.draw();
      }

      Regards,
      Eric



      On Feb 14, 2006, at 4:35 PM, pbentsen wrote:

      Hi there.

      I was looking at your treeview as possible navigation menu for a
      website. For this I would like to save the menu expand state between
      page loads in a cookie.

      Is it possible to make the "expand child node" method call a user
      defined function e.g. save_cookie()?

      How about a treeview->on_expand_call(/user_function/)?

      Yours truely, Peter








      Yahoo! Groups Links

      <*> To visit your group on the web, go to:

      <*> To unsubscribe from this group, send an email to:

      <*> Your use of Yahoo! Groups is subject to:





    • jq_cf
      Did you every get this figured out?
      Message 2 of 3 , Aug 30 9:37 AM
      • 0 Attachment
        Did you every get this figured out?
      Your message has been successfully submitted and would be delivered to recipients shortly.