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

Links in a Treeview

Expand Messages
  • Santiago Cardarelli
    Hello everything!! I m using the treeview component: tree1 = new YAHOO.widget.TreeView( markup ); tree1.render(); The problem is that link al leaf level are
    Message 1 of 6 , Jul 3, 2009
      Hello everything!!

      I'm using the treeview component:

                tree1 = new YAHOO.widget.TreeView("markup");
                tree1.render();

      The problem is that link al leaf level are not working.

      Does anyone has experience with this component using links at leaf level within a tree?

      Thanks in advance for any help

      Regards
      Santiago


      Comparte tus fotos con tus amigos. Más fácil con Windows Live
    • Satyam
      Unfortunately it is so, the bug was noticed shortly after release. You can download the most recent version, fixed long ago, from Github:
      Message 2 of 6 , Jul 3, 2009
        Unfortunately it is so, the bug was noticed shortly after release. You
        can download the most recent version, fixed long ago, from Github:

        http://github.com/yui/yui2/tree/master

        in the /build/treeview folder you will find the latest build.



        Santiago Cardarelli escribió:
        >
        >
        > Hello everything!!
        >
        > I'm using the treeview component:
        >
        > tree1 = new YAHOO.widget.TreeView("markup");
        > tree1.render();
        >
        > The problem is that link al leaf level are not working.
        >
        > Does anyone has experience with this component using links at leaf
        > level within a tree?
        >
        > Thanks in advance for any help
        >
        > Regards
        > Santiago
        >
        > ------------------------------------------------------------------------
        > Comparte tus fotos con tus amigos. Más fácil con Windows Live
        > <http://download.live.com>
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.5.375 / Virus Database: 270.13.3/2216 - Release Date: 07/03/09 05:53:00
        >
        >
      • Santiago Cardarelli
        Thank you very much, Saytam!! It is working fine!! One more question, does it work with more than one link within each ? I m including three different
        Message 3 of 6 , Jul 6, 2009
          Thank you very much, Saytam!! It is working fine!!

          One more question, does it work with more than one link within each <li>?

          I'm including three different links but I'm only able to see only the first link.

          Thanks in advance

          Santiago


          To: ydn-javascript@yahoogroups.com
          From: satyam@...
          Date: Sat, 4 Jul 2009 00:35:35 +0200
          Subject: Re: [ydn-javascript] Links in a Treeview



          Unfortunately it is so, the bug was noticed shortly after release. You
          can download the most recent version, fixed long ago, from Github:

          http://github. com/yui/yui2/ tree/master

          in the /build/treeview folder you will find the latest build.

          Santiago Cardarelli escribió:
          >
          >
          > Hello everything!!
          >
          > I'm using the treeview component:
          >
          > tree1 = new YAHOO.widget. TreeView( "markup") ;
          > tree1.render( );
          >
          > The problem is that link al leaf level are not working.
          >
          > Does anyone has experience with this component using links at leaf
          > level within a tree?
          >
          > Thanks in advance for any help
          >
          > Regards
          > Santiago
          >
          > ------------ --------- --------- --------- --------- --------- -
          > Comparte tus fotos con tus amigos. Más fácil con Windows Live
          > <http://download. live.com>
          >
          >
          > ------------ --------- --------- --------- --------- --------- -
          >
          >
          > No virus found in this incoming message.
          > Checked by AVG - www.avg.com
          > Version: 8.5.375 / Virus Database: 270.13.3/2216 - Release Date: 07/03/09 05:53:00
          >
          >



          Diferentes formas de estar en contacto con amigos y familiares. Descúbrelas. Descúbrelas.
        • Satyam
          When parsing existing markup, TreeView takes only the first element in the which means that if you have several elements, you have to enclose them in a
          Message 4 of 6 , Jul 7, 2009
            When parsing existing markup, TreeView takes only the first element in
            the <li> which means that if you have several elements, you have to
            enclose them in a single container so that they will be read as a single
            one.

            Thus, if you have:
            <li><a href="something">something</a><a
            href="somethingelse">somethingelse</a> .....

            only the first <a> will be read. Instead do:

            <li><div><a href="something">something</a><a
            href="somethingelse">somethingelse</a></div> ....

            or span or whatever suits you.

            Anyway, in this case, TreeView won't create a TextNode with href and
            target properties set but an HTMLNode. That means that when the click
            of the links bubbles up, it will be captured by the TreeView and it will
            do the default click action, which is setting the focus and toggling the
            node. You will have to listen to clickEvent and return false from your
            listener to prevent the default action from happening.

            Satyam



            Santiago Cardarelli escribió:
            >
            >
            > Thank you very much, Saytam!! It is working fine!!
            >
            > One more question, does it work with more than one link within each <li>?
            >
            > I'm including three different links but I'm only able to see only the
            > first link.
            >
            > Thanks in advance
            >
            > Santiago
            >
            > ------------------------------------------------------------------------
            > To: ydn-javascript@yahoogroups.com
            > From: satyam@...
            > Date: Sat, 4 Jul 2009 00:35:35 +0200
            > Subject: Re: [ydn-javascript] Links in a Treeview
            >
            >
            >
            > Unfortunately it is so, the bug was noticed shortly after release. You
            > can download the most recent version, fixed long ago, from Github:
            >
            > http://github.com/yui/yui2/tree/master
            > <http://github.com/yui/yui2/tree/master>
            >
            > in the /build/treeview folder you will find the latest build.
            >
            > Santiago Cardarelli escribió:
            > >
            > >
            > > Hello everything!!
            > >
            > > I'm using the treeview component:
            > >
            > > tree1 = new YAHOO.widget.TreeView("markup");
            > > tree1.render();
            > >
            > > The problem is that link al leaf level are not working.
            > >
            > > Does anyone has experience with this component using links at leaf
            > > level within a tree?
            > >
            > > Thanks in advance for any help
            > >
            > > Regards
            > > Santiago
            > >
            > > ----------------------------------------------------------
            > > Comparte tus fotos con tus amigos. Más fácil con Windows Live
            > > <http://download.live.com <http://download.live.com>>
            > >
            > >
            > > ----------------------------------------------------------
            > >
            > >
            > > No virus found in this incoming message.
            > > Checked by AVG - www.avg.com
            > > Version: 8.5.375 / Virus Database: 270.13.3/2216 - Release Date:
            > 07/03/09 05:53:00
            > >
            > >
            >
            >
            > ------------------------------------------------------------------------
            > Diferentes formas de estar en contacto con amigos y familiares.
            > Descúbrelas. Descúbrelas.
            > <http://www.microsoft.com/windows/windowslive/default.aspx>
            >
            >
            > ------------------------------------------------------------------------
            >
            >
            > No virus found in this incoming message.
            > Checked by AVG - www.avg.com
            > Version: 8.5.386 / Virus Database: 270.13.5/2220 - Release Date: 07/05/09 17:54:00
            >
            >
          • Santiago Cardarelli
            Thank you very much, Satyam! Do you know how I have to do what you recommended? Thanks in advance Santiago To: ydn-javascript@yahoogroups.com From:
            Message 5 of 6 , Jul 7, 2009
              Thank you very much, Satyam!

              Do you know how I have to do what you recommended?

              Thanks in advance
              Santiago



              To: ydn-javascript@yahoogroups.com
              From: satyam@...
              Date: Tue, 7 Jul 2009 09:49:17 +0200
              Subject: Re: [ydn-javascript] Links in a Treeview



              When parsing existing markup, TreeView takes only the first element in
              the <li> which means that if you have several elements, you have to
              enclose them in a single container so that they will be read as a single
              one.

              Thus, if you have:
              <li><a href="something" >something< /a><a
              href="somethingelse ">somethingelse< /a> .....

              only the first <a> will be read. Instead do:

              <li><div><a href="something" >something< /a><a
              href="somethingelse ">somethingelse< /a></div> ....

              or span or whatever suits you.

              Anyway, in this case, TreeView won't create a TextNode with href and
              target properties set but an HTMLNode. That means that when the click
              of the links bubbles up, it will be captured by the TreeView and it will
              do the default click action, which is setting the focus and toggling the
              node. You will have to listen to clickEvent and return false from your
              listener to prevent the default action from happening.

              Satyam

              Santiago Cardarelli escribió:
              >
              >
              > Thank you very much, Saytam!! It is working fine!!
              >
              > One more question, does it work with more than one link within each <li>?
              >
              > I'm including three different links but I'm only able to see only the
              > first link.
              >
              > Thanks in advance
              >
              > Santiago
              >
              > ------------ --------- --------- --------- --------- --------- -
              > To: ydn-javascript@ yahoogroups. com
              > From: satyam@satyam. com.ar
              > Date: Sat, 4 Jul 2009 00:35:35 +0200
              > Subject: Re: [ydn-javascript] Links in a Treeview
              >
              >
              >
              > Unfortunately it is so, the bug was noticed shortly after release. You
              > can download the most recent version, fixed long ago, from Github:
              >
              > http://github. com/yui/yui2/ tree/master
              > <http://github. com/yui/yui2/ tree/master>
              >
              > in the /build/treeview folder you will find the latest build.
              >
              > Santiago Cardarelli escribió:
              > >
              > >
              > > Hello everything!!
              > >
              > > I'm using the treeview component:
              > >
              > > tree1 = new YAHOO.widget. TreeView( "markup") ;
              > > tree1.render( );
              > >
              > > The problem is that link al leaf level are not working.
              > >
              > > Does anyone has experience with this component using links at leaf
              > > level within a tree?
              > >
              > > Thanks in advance for any help
              > >
              > > Regards
              > > Santiago
              > >
              > > ------------ --------- --------- --------- --------- --------- -
              > > Comparte tus fotos con tus amigos. Más fácil con Windows Live
              > > <http://download. live.com <http://download. live.com>>
              > >
              > >
              > > ------------ --------- --------- --------- --------- --------- -
              > >
              > >
              > > No virus found in this incoming message.
              > > Checked by AVG - www.avg.com
              > > Version: 8.5.375 / Virus Database: 270.13.3/2216 - Release Date:
              > 07/03/09 05:53:00
              > >
              > >
              >
              >
              > ------------ --------- --------- --------- --------- --------- -
              > Diferentes formas de estar en contacto con amigos y familiares.
              > Descúbrelas. Descúbrelas.
              > <http://www.microsof t.com/windows/ windowslive/ default.aspx>
              >
              >
              > ------------ --------- --------- --------- --------- --------- -
              >
              >
              > No virus found in this incoming message.
              > Checked by AVG - www.avg.com
              > Version: 8.5.386 / Virus Database: 270.13.5/2220 - Release Date: 07/05/09 17:54:00
              >
              >



              Nuevo Windows Live, un mundo lleno de posibilidades Descúbrelo.
            • Satyam
              I told you about how to enclose several HTML elements into a single container for the benefit of the parser so for the clickEvent, you do:
              Message 6 of 6 , Jul 7, 2009
                I told you about how to enclose several HTML elements into a single
                container for the benefit of the parser so for the clickEvent, you do:

                myTree.subscribe('clickEvent',function (oArgs) {
                return false;
                });

                That will prevent the default action to be taken. Of course, you could
                do anything you want besides preventing the default, in fact, it is
                frequent to put fake links in the tree (like href="#0") and do the
                actual jumping in the clickEvent depending on the value of the href
                value. It is certainly NOT recommended to have href="javascript: ...."
                type of links, that's what events such as clickEvent are there for.
                Your HTML should not contain code.

                Satyam


                Santiago Cardarelli escribió:
                >
                >
                > Thank you very much, Satyam!
                >
                > Do you know how I have to do what you recommended?
                >
                > Thanks in advance
                > Santiago
                >
                >
                > ------------------------------------------------------------------------
                > To: ydn-javascript@yahoogroups.com
                > From: satyam@...
                > Date: Tue, 7 Jul 2009 09:49:17 +0200
                > Subject: Re: [ydn-javascript] Links in a Treeview
                >
                >
                >
                > When parsing existing markup, TreeView takes only the first element in
                > the <li> which means that if you have several elements, you have to
                > enclose them in a single container so that they will be read as a single
                > one.
                >
                > Thus, if you have:
                > <li><a href="something">something</a><a
                > href="somethingelse">somethingelse</a> .....
                >
                > only the first <a> will be read. Instead do:
                >
                > <li><div><a href="something">something</a><a
                > href="somethingelse">somethingelse</a></div> ....
                >
                > or span or whatever suits you.
                >
                > Anyway, in this case, TreeView won't create a TextNode with href and
                > target properties set but an HTMLNode. That means that when the click
                > of the links bubbles up, it will be captured by the TreeView and it will
                > do the default click action, which is setting the focus and toggling the
                > node. You will have to listen to clickEvent and return false from your
                > listener to prevent the default action from happening.
                >
                > Satyam
                >
                > Santiago Cardarelli escribió:
                > >
                > >
                > > Thank you very much, Saytam!! It is working fine!!
                > >
                > > One more question, does it work with more than one link within each
                > <li>?
                > >
                > > I'm including three different links but I'm only able to see only the
                > > first link.
                > >
                > > Thanks in advance
                > >
                > > Santiago
                > >
                > > ----------------------------------------------------------
                > > To: ydn-javascript@yahoogroups.com
                > <mailto:ydn-javascript@yahoogroups.com>
                > > From: satyam@... <mailto:satyam@...>
                > > Date: Sat, 4 Jul 2009 00:35:35 +0200
                > > Subject: Re: [ydn-javascript] Links in a Treeview
                > >
                > >
                > >
                > > Unfortunately it is so, the bug was noticed shortly after release. You
                > > can download the most recent version, fixed long ago, from Github:
                > >
                > > http://github.com/yui/yui2/tree/master
                > <http://github.com/yui/yui2/tree/master>
                > > <http://github.com/yui/yui2/tree/master
                > <http://github.com/yui/yui2/tree/master>>
                > >
                > > in the /build/treeview folder you will find the latest build.
                > >
                > > Santiago Cardarelli escribió:
                > > >
                > > >
                > > > Hello everything!!
                > > >
                > > > I'm using the treeview component:
                > > >
                > > > tree1 = new YAHOO.widget.TreeView("markup");
                > > > tree1.render();
                > > >
                > > > The problem is that link al leaf level are not working.
                > > >
                > > > Does anyone has experience with this component using links at leaf
                > > > level within a tree?
                > > >
                > > > Thanks in advance for any help
                > > >
                > > > Regards
                > > > Santiago
                > > >
                > > > ----------------------------------------------------------
                > > > Comparte tus fotos con tus amigos. Más fácil con Windows Live
                > > > <http://download.live.com <http://download.live.com>
                > <http://download.live.com <http://download.live.com>>>
                > > >
                > > >
                > > > ----------------------------------------------------------
                > > >
                > > >
                > > > No virus found in this incoming message.
                > > > Checked by AVG - www.avg.com
                > > > Version: 8.5.375 / Virus Database: 270.13.3/2216 - Release Date:
                > > 07/03/09 05:53:00
                > > >
                > > >
                > >
                > >
                > > ----------------------------------------------------------
                > > Diferentes formas de estar en contacto con amigos y familiares.
                > > Descúbrelas. Descúbrelas.
                > > <http://www.microsoft.com/windows/windowslive/default.aspx
                > <http://www.microsoft.com/windows/windowslive/default.aspx>>
                > >
                > >
                > > ----------------------------------------------------------
                > >
                > >
                > > No virus found in this incoming message.
                > > Checked by AVG - www.avg.com
                > > Version: 8.5.386 / Virus Database: 270.13.5/2220 - Release Date:
                > 07/05/09 17:54:00
                > >
                > >
                >
                >
                > ------------------------------------------------------------------------
                > Nuevo Windows Live, un mundo lleno de posibilidades Descúbrelo.
                > <http://www.microsoft.com/windows/windowslive/default.aspx>
                >
                >
                > ------------------------------------------------------------------------
                >
                >
                > No virus found in this incoming message.
                > Checked by AVG - www.avg.com
                > Version: 8.5.386 / Virus Database: 270.13.6/2221 - Release Date: 07/06/09 17:54:00
                >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.