Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / 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 (file)
index 0000000..f1b5e93
--- /dev/null
@@ -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;
+    }
+});