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

Re: Tree view again

Expand Messages
  • dufferdo25
    Very nice! ... 29/09/2008 7:40
    Message 1 of 5 , Sep 29, 2008
      Very nice!

      --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
      >
      > Makes sense. It can be shorter:
      >
      > root = new YAHOO.widget.TextNode(
      > { label: 'node3', id: 'node3' },
      > tree.getRoot(),
      > cookiePersist && cookiePersist.search('node3') != -1
      > );
      >
      > Satyam
      >
      > dufferdo25 wrote:
      > > I am saving the state of my tree using a cookie to "persist" each
      > > nodes state. Depending on the size of your tree and the depth, this
      > > may or may not be practical.
      > >
      > > I am doing something like this:
      > > cookie value += "node label value" {delimited by |}
      > > so
      > > treeCookie value = node1|node2|node4
      > >
      > > var rootLabel = { label: 'node3', id: 'node3' };
      > > //see if cookie exists
      > > if(cookiePersist != null) {
      > > var bRootExpanded = (cookiePersist.search('node3') != -1)
      > > ? true : false;
      > > }
      > > root = new YAHOO.widget.TextNode(rootLabel, tree.getRoot(),
      > > bRootExpanded);
      > >
      > > so for node with a label of "node3", it would be collapsed as this
      > > value is not stored in cookie, however node with label value of
      > > "node1" is expanded as it is stored in cookie.
      > >
      > > Hope that makes sense.
      > >
      > >
      > >
      > > ------------------------------------
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > >
      ------------------------------------------------------------------------
      > >
      > >
      > > No virus found in this incoming message.
      > > Checked by AVG - http://www.avg.com
      > > Version: 8.0.169 / Virus Database: 270.7.5/1697 - Release Date:
      29/09/2008 7:40
      > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.