X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/src/core/examples/src/Sample/Developer.js diff --git a/src/core/examples/src/Sample/Developer.js b/src/core/examples/src/Sample/Developer.js new file mode 100644 index 00000000..f1b5e93d --- /dev/null +++ b/src/core/examples/src/Sample/Developer.js @@ -0,0 +1,43 @@ +Ext.define('Sample.Developer', { + extend: 'Sample.Person', + + statics: { + averageIQ: 120 + }, + + config: { + languages: ['JavaScript', 'C++', 'Python'] + }, + + constructor: function(config) { + this.isGeek = true; + + // Apply a method from the parent class' prototype + return this.callParent(arguments); + }, + + canCode: function(language) { + return Ext.Array.contains(this.getLanguages(), language); + }, + + code: function(language) { + if (!this.canCode(language)) { + alert("I can't code in: " + language); + + return this; + } + + alert("I'm coding in: " + language); + + this.eat("Bugs"); + + return this; + }, + + clone: function() { + var self = this.statics(), + cloned = new self(this.config); + + return cloned; + } +});