Greg Hinch![]()
Similar to Y.Widget.getByNode, this module adds a Y.View.getByNode. Note that in order to get Views you create, you will need to extend them with Y.Ext.ViewByNode.
YUI().use('gallery-viewbynode', 'base-build', function(Y) {
var MyView = Y.Base.create('my-view', Y.View, [Y.Ext.ViewByNode],{
render : function () {
if (!this.container.inDoc()) {
Y.one('body').append(this.container);
}
}
},{});
var inst = new MyView();
inst.render();
Y.View.getByNode(inst.container); // Returns inst
});
© 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