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

Focusing on a tree node

Expand Messages
  • binouch2009
    I am using the YUI tree that s displayed in a container. The container is about 700px long but the list of nodes is much longer than that. The tree works as a
    Message 1 of 3 , Jul 1 6:05 AM
    • 0 Attachment
      I am using the YUI tree that's displayed in a container. The container is about 700px long but the list of nodes is much longer than that. The tree works as a file system navigator and depending on where in the "file system" the page is certain nodes will be expanded. What i would like to achieve is for the focus to be set on the last expanded node when the page is rendered. Is such a thing doable?

      Thank you in advance for your help.
    • Satyam
      All kinds of nodes have a method focus() inherited from Node so, as long as you have a reference to which node you want to set the focus on you can just call
      Message 2 of 3 , Jul 1 8:44 AM
      • 0 Attachment
        All kinds of nodes have a method focus() inherited from Node so, as long
        as you have a reference to which node you want to set the focus on you
        can just call focus on it. All the nodes from the root to the focused
        node will be expanded. Scrolling the container of the TreeView so that
        the node with the focus moves to within the viewable area is out of the
        ability of the TreeView itself, a widget cannot have any control on the
        elements further up in the DOM hierarchy though I assume the browser
        will take care of that, depending on the setting for the scrollbars on
        the container.

        To keep information in between sessions you can use the YUI Cookie
        utility. Since you cannot store a Node object in it, you can store the
        value of any significant property of the node to be focused in it.
        Method getNodeByProperty might help you locate the same node once again
        in the next session.

        Satyam

        binouch2009 escribió:
        > I am using the YUI tree that's displayed in a container. The container is about 700px long but the list of nodes is much longer than that. The tree works as a file system navigator and depending on where in the "file system" the page is certain nodes will be expanded. What i would like to achieve is for the focus to be set on the last expanded node when the page is rendered. Is such a thing doable?
        >
        > Thank you in advance for your help.
        >
        >
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.5.375 / Virus Database: 270.13.1/2211 - Release Date: 06/30/09 11:37:00
        >
        >
      • binouch2009
        Cool - thanks for the info Satyam, I ll try to use the focus() method then.
        Message 3 of 3 , Jul 2 12:27 AM
        • 0 Attachment
          Cool - thanks for the info Satyam, I'll try to use the focus() method then.


          --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
          >
          > All kinds of nodes have a method focus() inherited from Node so, as long
          > as you have a reference to which node you want to set the focus on you
          > can just call focus on it. All the nodes from the root to the focused
          > node will be expanded. Scrolling the container of the TreeView so that
          > the node with the focus moves to within the viewable area is out of the
          > ability of the TreeView itself, a widget cannot have any control on the
          > elements further up in the DOM hierarchy though I assume the browser
          > will take care of that, depending on the setting for the scrollbars on
          > the container.
          >
          > To keep information in between sessions you can use the YUI Cookie
          > utility. Since you cannot store a Node object in it, you can store the
          > value of any significant property of the node to be focused in it.
          > Method getNodeByProperty might help you locate the same node once again
          > in the next session.
          >
          > Satyam
          >
          > binouch2009 escribi�:
          > > I am using the YUI tree that's displayed in a container. The container is about 700px long but the list of nodes is much longer than that. The tree works as a file system navigator and depending on where in the "file system" the page is certain nodes will be expanded. What i would like to achieve is for the focus to be set on the last expanded node when the page is rendered. Is such a thing doable?
          > >
          > > Thank you in advance for your help.
          > >
          > >
          > >
          > >
          > >
          > > ------------------------------------
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > > ------------------------------------------------------------------------
          > >
          > >
          > > No virus found in this incoming message.
          > > Checked by AVG - www.avg.com
          > > Version: 8.5.375 / Virus Database: 270.13.1/2211 - Release Date: 06/30/09 11:37:00
          > >
          > >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.