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>