Search the web
Sign In
New User? Sign Up
ydn-javascript · Yahoo! User Interface Library Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
TreeView and Labels. Newbie Q. Pls. help.   Message List  
Reply | Forward Message #50254 of 52114 |
Re: [ydn-javascript] TreeView and Labels. Newbie Q. Pls. help.

The TreeView generates its own ids on each of the nodes so the ids of
the original markup is lost. The attribute 'class' is converted to
'className' so you can use:

alert(tree.getNodeByProperty('className','mylabel1').label);

Satyam


mario25960 escribió:
> hello
>
> a newbie question, but I am unable to find the answer looking at the API.
> In treeview, when I render the tree, how can I get labels from the markup
(e.g. in the example below, myid1 for that tree node).
>
> A quick tutorial would be very welcome.
> Thanks best wishes
> mario
>
>
> =======================
> ......
> <script type="text/javascript">
>
> var tree;
> function treeInit() {
> tree = new YAHOO.widget.TreeView("treeDiv1");
> var root = tree.getRoot();
> tree.subscribe("expand", function(node) {
> alert("node.label: "+ node.label);
> alert("node.getLabelEl().innerHTML : " + node.getLabelEl().innerHTML);
> });
> tree.render();
> }
> YAHOO.util.Event.onDOMReady(treeInit);
> </script>
> </head>
> <body class="yui-skin-sam">
> <div id="treeDiv1">
> <ul class>
> <li >List 0
> <li class="mylabel1" id="myid1" >List 0-0
> <ul>
> <li>item 0-0-0</li>
> <li>item 0-0-1 </li>
> </ul>
> </li>
> </li>
> </ul>
> </div>
> </body>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.375 / Virus Database: 270.13.4/2218 - Release Date: 07/04/09
17:55:00
>
>



Sun Jul 5, 2009 2:50 pm

satyamutsa
Offline Offline
Send Email Send Email

Forward
Message #50254 of 52114 |
Expand Messages Author Sort by Date

hello a newbie question, but I am unable to find the answer looking at the API. In treeview, when I render the tree, how can I get labels from the markup...
mario25960
Offline Send Email
Jul 5, 2009
12:52 pm

The TreeView generates its own ids on each of the nodes so the ids of the original markup is lost. The attribute 'class' is converted to 'className' so you...
Satyam
satyamutsa
Offline Send Email
Jul 5, 2009
2:51 pm

Hello I see. I'll post a more general question tomorrow morning. Thanks for your reply. My best wishes mario ... .... escribió ??...
mario25960
Offline Send Email
Jul 5, 2009
7:35 pm

Hello so, tree.getNodeByProperty("className","mylabel1").className returns mylabel1; tree.getNodeByProperty("className","mylabel1").label returns List 0-0; I...
mario25960
Offline Send Email
Jul 6, 2009
1:26 pm

... You can't. I told you, the TreeView makes its own ids, which it needs to for its internal workings, and since any element can't have more than a single...
Satyam
satyamutsa
Offline Send Email
Jul 6, 2009
2:04 pm

Hi thanks for the long reply. I'll think about and let you know what I am able to sort out. My best wishes mario...
mario25960
Offline Send Email
Jul 6, 2009
3:53 pm
bainania
Offline Send Email
Jul 6, 2009
3:59 pm

... how do you read it? tree.getNodeByProperty("yuiConfig", ???? ) ? thks mario...
mario25960
Offline Send Email
Jul 6, 2009
9:49 pm

You don't read yuiConfig. yuiConfig is the means by which you can add extra properties for the enhanced widget that are not available from the original...
Satyam
satyamutsa
Offline Send Email
Jul 7, 2009
7:45 am

Hi, thks for the reply. I had already tried with json, but it seems to create some kind of conflict. See the simple code below. If you cut ... does not seem so...
mario25960
Offline Send Email
Jul 7, 2009
8:30 am

Hello I would enjoy some more advise. Is anybody able to replicate what I get with the code below (with and without json link)? If so, does anybody know why?...
mario25960
Offline Send Email
Jul 9, 2009
8:58 am

Mario, check the docs at: http://developer.yahoo.com/yui/treeview/ It shows an example like below: < li yuiConfig = '{"type":"DateNode","editable":true}'...
Paolo Nesti Poggi
paolonesti
Offline Send Email
Jul 9, 2009
9:51 am

Hello yes, it works! Thanks. Need to look into this stuff better. My best wishes ps. reply form does not show previous message, I cut&paste it by myself ... ...
mario25960
Offline Send Email
Jul 11, 2009
5:26 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help