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

Save treeview state in cookie

Expand Messages
  • pbentsen
    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
    Message 1 of 3 , Feb 14, 2006
    • 0 Attachment
      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
    • 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 2 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 3 of 3 , Aug 30, 2007
        • 0 Attachment
          Did you every get this figured out?
        Your message has been successfully submitted and would be delivered to recipients shortly.