Forums

Posting in these forums is disabled. These forums will be available for archive purposes. Please join the new forums at the links below:

  • yui-support - replaces the `YUI 3.x` and `YUI 3 Gallery` forums.
    We have created the following discussion categories within this group to aid discoverability for these most-used topics:
    • Charts for YUI Charts support.
    • DataTable for YUI DataTable support.
    • Gallery for YUI Gallery support, including support for published Gallery components as well as the Gallery process in general.
    • Tools for support of YUI’s suite of developer tools such as selleck, shifter, grover, yogi, etc.
    • Everything Else for questions that don’t fit one of the categories above, we’ve got you covered here.
  • yui-deprecated - replaces the `YUI 2.x` forum and the forums of other deprecated products (`YUI Doc`, `Builder`, `YUI PHP Loader`, etc.).
  [ 2 posts ]
New Topic | Post Reply | Print view
Previous topic | Next topic

krishna

  • Username: krishna595
  • Joined: Tue Apr 03, 2012 4:02 am
  • Posts: 5
  • Offline
  • Profile
Tags:
  • css
  • view

tree view

Post Posted: Tue Apr 03, 2012 5:39 am
+0-
Hi team

i m trying to implement the tree view in my application.

i have gone thru the getting started example.To some extent i got what i need to do later on i could not get could some one please tell me how to proceed further from where i m stuck.

here the steps what i did .
1 .copied all the css and js links
2. given the reqiured class name to the body tag
3. wrote the following function
<script....
var tree;
function treeInit() {
tree = new YAHOO.widget.TreeView("treeDiv1");
}
</script>
4.i have created a div as follows.
<div id="treeDiv1">
<ul>
<li class="expanded">List 0
<ul>
<li class="expanded">List 0-0
<ul>
<li>item 0-0-0</li>
<li><a target="_new" href="www.elsewhere.com" title="go elsewhere">elsewhere</a></li>
</ul>
</li>
</ul>
</li>
<li>List 1
<ul>
<li>List 1-0
<ul>
<li yuiConfig='{"type":"DateNode","editable":true}'>02/01/2009</li>
<li><span>item <strong>1-1-0</strong></span></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>

5.from here on words i did not get how to proceed on.

so started experimenting in different ways by including the below mentioned script at the end and tried but still i culd not get how does it works

var tree;
function treeInit() {
tree = new YAHOO.widget.TreeView("treeDiv1");
var root = tree.getRoot();
var tmpNode = new YAHOO.widget.TextNode({
label: "mylabel1",
expanded: false
}, root);
var tmpNode2 = new YAHOO.widget.TextNode({
label: "mylabel1-1",
expanded: false
}, tmpNode);

tree.render();
}

Please help me out .

i have an Unordered list and i need to create the tree structure view for it . please tell me how to do.

Thanks & regards
sai krishna

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2017
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile
Tags:
  • view

Re: tree view

Post Posted: Tue Apr 03, 2012 8:40 am
+0-
In the first piece of code you show, the call to the render method is missing so nothing will come out. In the second, you do have the call to render and it should show fine. However, neither of this is the whole story. You say you copied all the links. You mean that you copied some of the files of the YUI library to your local machine? That is usually the cause of trouble since you might be missing something and some of the references from one to the other might be missing. Why not try it out from YAHOO's own servers? If you want to learn programming with the YUI Library, that is the best. If you want to learn how to administer a library installation, that is a completely different subject and it is not the way to begin.

A good place to try out things and test them is jsfiddle.net. You can share your working code right there and see what happens.
  [ 2 posts ]
New Topic | Post Reply | Print view
Previous topic | Next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum