Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / src / core / examples / src / Sample / Developer.js
1 Ext.define('Sample.Developer', {
2     extend: 'Sample.Person',
3
4     statics: {
5         averageIQ: 120
6     },
7
8     config: {
9         languages: ['JavaScript', 'C++', 'Python']
10     },
11
12     constructor: function(config) {
13         this.isGeek = true;
14
15         // Apply a method from the parent class' prototype
16         return this.callParent(arguments);
17     },
18
19     canCode: function(language) {
20         return Ext.Array.contains(this.getLanguages(), language);
21     },
22
23     code: function(language) {
24         if (!this.canCode(language)) {
25             alert("I can't code in: " + language);
26
27             return this;
28         }
29
30         alert("I'm coding in: " + language);
31
32         this.eat("Bugs");
33
34         return this;
35     },
36
37     clone: function() {
38         var self = this.statics(),
39             cloned = new self(this.config);
40
41         return cloned;
42     }
43 });