1 <!DOCTYPE html><html><head><title>Ext.Base | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
2 <style type="text/css">.head-band { display: none; }
3 .header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
4 .doc-tab .members .member a.more { background-color: #efefef; }
5 </style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
6 </head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit
7 <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">
12 origDocClass: 'Ext.Base',
27 <script type="text/javascript" src="../search.js"></script>
28 <!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
29 <script type="text/javascript" src="../class_tree.js"></script>
30 <script type="text/javascript" src="../class_doc.js"></script>
31 <script type="text/javascript">
32 req.source = 'Base3.html#Ext-Base';
33 clsInfo = {"methods":["callOverridden","getName"],"cfgs":[],"properties":["addStatics","borrow","create","createAlias","implement","override"],"events":[],"subclasses":["Ext.form.action.Action","Ext.slider.Thumb","Ext.env.Browser"]};
34 Ext.onReady(function() {
35 Ext.create('Docs.classPanel');
37 </script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/Base3.html#Ext-Base" target="_blank">Ext.Base</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><p>The root of all classes created with <a href="Ext.html#define" rel="Ext#define" class="docClass">Ext.define</a>
38 All prototype and static members of this class are inherited by any other class</p>
39 <div class="members"><div class="m-properties"><a name="properties"></a><div class="definedBy">Defined By</div><h3 class="prp p">Properties</h3><div id="property-addStatics" class="member f ni"><a href="Ext.Base.html#property-addStatics" rel="property-addStatics" class="expand more ar"><span> </span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-addStatics" class="viewSource">view source</a></div><a name="addStatics"></a><a name="property-addStatics"></a><a href="Ext.Base.html#" rel="property-addStatics" class="cls expand">addStatics</a><span> : Function</span></div><div class="description"><div class="short">Add / override static properties of this class.
41 Ext.define('My.cool.Class', {
45 My.cool.Class.addStatics(...</div><div class="long"><p>Add / override static properties of this class.</p>
47 <pre><code>Ext.define('My.cool.Class', {
51 My.cool.Class.addStatics({
52 someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'
53 method1: function() { ... }, // My.cool.Class.method1 = function() { ... };
54 method2: function() { ... } // My.cool.Class.method2 = function() { ... };
57 </div></div></div><div id="property-borrow" class="member ni"><a href="Ext.Base.html#property-borrow" rel="property-borrow" class="expand more ar"><span> </span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-borrow" class="viewSource">view source</a></div><a name="borrow"></a><a name="property-borrow"></a><a href="Ext.Base.html#" rel="property-borrow" class="cls expand">borrow</a><span> : Function</span></div><div class="description"><div class="short">Borrow another class' members to the prototype of this class.
62 printMoney: functi...</div><div class="long"><p>Borrow another class' members to the prototype of this class.</p>
64 <p>Ext.define('Bank', {</p>
66 <pre><code>money: '$$$',
67 printMoney: function() {
74 <p>Ext.define('Thief', {</p>
81 <p>Thief.borrow(Bank, ['money', 'printMoney']);</p>
83 <p>var steve = new Thief();</p>
85 <p>alert(steve.money); // alerts '$$$'
86 steve.printMoney(); // alerts '$$$$$$$'</p>
87 </div></div></div><div id="property-create" class="member ni"><a href="Ext.Base.html#property-create" rel="property-create" class="expand more ar"><span> </span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-create" class="viewSource">view source</a></div><a name="create"></a><a name="property-create"></a><a href="Ext.Base.html#" rel="property-create" class="cls expand">create</a><span> : Function</span></div><div class="description"><div class="short">Create a new instance of this Class.
88 Ext.define('My.cool.Class', {
95 My.cool.Class.create({
97 someConfig: tr...</div><div class="long"><p>Create a new instance of this Class.
98 Ext.define('My.cool.Class', {</p>
105 <p>My.cool.Class.create({</p>
107 <pre><code>someConfig: true
111 </div></div></div><div id="property-createAlias" class="member ni"><a href="Ext.Base.html#property-createAlias" rel="property-createAlias" class="expand more ar"><span> </span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-createAlias" class="viewSource">view source</a></div><a name="createAlias"></a><a name="property-createAlias"></a><a href="Ext.Base.html#" rel="property-createAlias" class="cls expand">createAlias</a><span> : Function</span></div><div class="description"><div class="short">Create aliases for existing prototype methods. Example:
113 Ext.define('My.cool.Class', {
114 method1: function() { ... ...</div><div class="long"><p>Create aliases for existing prototype methods. Example:</p>
116 <pre><code>Ext.define('My.cool.Class', {
117 method1: function() { ... },
118 method2: function() { ... }
121 var test = new My.cool.Class();
123 My.cool.Class.createAlias({
128 test.method3(); // test.method1()
130 My.cool.Class.createAlias('method5', 'method3');
132 test.method5(); // test.method3() -> test.method1()
134 </div></div></div><div id="property-implement" class="member ni"><a href="Ext.Base.html#property-implement" rel="property-implement" class="expand more ar"><span> </span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-implement" class="viewSource">view source</a></div><a name="implement"></a><a name="property-implement"></a><a href="Ext.Base.html#" rel="property-implement" class="cls expand">implement</a><span> : Function</span></div><div class="description"><div class="short">Add methods / properties to the prototype of this class.
136 Ext.define('My.awesome.Cat', {
137 constructor: function() ...</div><div class="long"><p>Add methods / properties to the prototype of this class.</p>
139 <pre><code>Ext.define('My.awesome.Cat', {
140 constructor: function() {
145 My.awesome.Cat.implement({
151 var kitty = new My.awesome.Cat;
154 </div></div></div><div id="property-override" class="member ni"><a href="Ext.Base.html#property-override" rel="property-override" class="expand more ar"><span> </span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-override" class="viewSource">view source</a></div><a name="override"></a><a name="property-override"></a><a href="Ext.Base.html#" rel="property-override" class="cls expand">override</a><span> : Function</span></div><div class="description"><div class="short">Override prototype members of this class. Overridden methods can be invoked via
157 Ext.define('My.Cat', ...</div><div class="long"><p>Override prototype members of this class. Overridden methods can be invoked via
158 <a href="Ext.Base.html#callOverridden" rel="Ext.Base#callOverridden" class="docClass">callOverridden</a></p>
160 <pre><code>Ext.define('My.Cat', {
161 constructor: function() {
169 constructor: function() {
170 alert("I'm going to be a cat!");
172 var instance = this.callOverridden();
174 alert("Meeeeoooowwww");
180 var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
181 // alerts "I'm a cat!"
182 // alerts "Meeeeoooowwww"
184 </div></div></div></div><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-callOverridden" class="member f ni"><a href="Ext.Base.html#method-callOverridden" rel="method-callOverridden" class="expand more ar"><span> </span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-method-callOverridden" class="viewSource">view source</a></div><a name="callOverridden"></a><a name="method-callOverridden"></a><a href="Ext.Base.html#" rel="method-callOverridden" class="cls expand">callOverridden</a>(
185 <span class="pre">Array/Arguments args</span>)
186 : Mixed</div><div class="description"><div class="short">Call the original method that was previously overridden with override
188 Ext.define('My.Cat', {
189 constructor: functi...</div><div class="long"><p>Call the original method that was previously overridden with <a href="Ext.Base.html#override" rel="Ext.Base#override" class="docClass">override</a></p>
191 <pre><code>Ext.define('My.Cat', {
192 constructor: function() {
200 constructor: function() {
201 alert("I'm going to be a cat!");
203 var instance = this.callOverridden();
205 alert("Meeeeoooowwww");
211 var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
212 // alerts "I'm a cat!"
213 // alerts "Meeeeoooowwww"
215 <h3 class="pa">Parameters</h3><ul><li><span class="pre">args</span> : Array/Arguments<div class="sub-desc"><p>The arguments, either an array or the <code>arguments</code> object</p>
216 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Mixed</span> <p>Returns the result after calling the overridden method</p>
217 </li></ul></div></div></div><div id="method-getName" class="member ni"><a href="Ext.Base.html#method-getName" rel="method-getName" class="expand more ar"><span> </span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-method-getName" class="viewSource">view source</a></div><a name="getName"></a><a name="method-getName"></a><a href="Ext.Base.html#" rel="method-getName" class="cls expand">getName</a> : String</div><div class="description"><div class="short">Get the current class' name in string format.
219 Ext.define('My.cool.Class', {
220 constructor: function() {
221 al...</div><div class="long"><p>Get the current class' name in string format.</p>
223 <pre><code>Ext.define('My.cool.Class', {
224 constructor: function() {
225 alert(this.self.getName()); // alerts 'My.cool.Class'
229 My.cool.Class.getName(); // 'My.cool.Class'
231 <h3 class="pa">Returns</h3><ul><li><span class="pre">String</span> <p>className</p>
232 </li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>