Created
May 21, 2010 16:58
-
-
Save sdesai/409095 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MyWidget(config) { | |
MyWidget.superclass.constructor.apply(this, arguments); | |
} | |
MyWidget.NAME = 'mywidget'; | |
MyWidget.ATTRS = { | |
nodes: { | |
value: null | |
} | |
}; | |
MyWidget.HTML_PARSER = { | |
nodes: function(srcNode) { | |
var nodeList = srcNode.all('div.test'); | |
console.log('HTML_PARSER has run and found nodes: ' + nodeList); | |
return nodeList; | |
} | |
}; | |
Y.extend(MyWidget, Y.Widget, { | |
initializer: function() { | |
console.log('ATTRS value for "nodes" is: ' + this.get('nodes')); | |
} | |
}); | |
console.log('Creating instance of MyWidget without any user configuration'); | |
var myWidgetWithoutUserConfig = new MyWidget({srcNode:".mywidgetcontent"}); | |
myWidgetWithoutUserConfig.render(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment