Gonzalo Cordero![]()
Take a look at the first iteration of the new YUI3 Treeview.
Release notes:
Check out the following presentation for more info:
http://www.slideshare.net/gonzalocordero/preview-of-yui3-treeview
Here is a quick example on how you'd alert the label of a treeleaf:
myTreeview.on("treeleaf:click", function (e){
alert(e.target.get("label"));
});
In addition, TreeView publishes the following custom event:
More custom events will be added in the upcoming releases.
References:
<ul id="mytree">
<li>
<a href="progressive.html">Label</a>
<ul>
<li>
<span>I'm a tree leaf</span>
</li>
</ul>
</li>
<li>
<a href="progressive.html">label2</a>
<ul>
<li>
<span>I'm too</span>
</li>
</ul>
</li>
</ul>YUI().use('gallery-yui3treeview', function(Y) {
var treeview = new Y.TreeView({
srcNode: '#mytree',
contentBox: '#mytree',
boundingBox: '#mytree',
type : "TreeView"
});
treeview.render();
});
var treeview = new Y.TreeView({
srcNode: '#mytree',
contentBox: null,
type: "TreeView",
children: [
{
label: "level1-1",
type: "TreeView",
children: [
{label: "level2-1"},
{label: "level2-2"}
]
},
{
type: "TreeView",
label : "level1-2"
}
]
});
<script src="http://yui.yahooapis.com/3.3.0 PR3/build/yui/yui-min.js"></script><ul id="mytree"></ul>
YUI({
//Last Gallery Build of this module
gallery: 'gallery-2011.01.03-18-30'
}).use('gallery-yui3treeview', function(Y) {
var treeview = new Y.TreeView({
srcNode: '#mytree',
contentBox: null,
type: "TreeView",
children: [
{
label: "level1-1",
type: "TreeView",
children: [
{label: "level2-1"},
{label: "level2-2"}
]
},
{
type: "TreeView",
label : "level1-2"
}
]
});
treeview.render();
});
| Subject | Author | Date |
|---|---|---|
| Treeview notes | Gonzalo Cordero | 11/30/10 |
| Re: Treeview notes | Satyam | 12/1/10 |
| Re: Treeview notes | Gonzalo Cordero | 12/2/10 |
| Re: Treeview notes | Satyam | 12/2/10 |
| Re: Treeview notes | John Coady | 12/4/10 |
| Re: Treeview notes | Gonzalo Cordero | 12/8/10 |
| Re: Treeview notes | Stjepan Rajko | 12/23/10 |
| Re: Treeview notes | Gonzalo Cordero | 12/23/10 |
| TreeView type property | Donald Fincher | 12/27/10 |
| Re: Treeview notes | Stjepan Rajko | 12/27/10 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info