Ext.data.JsonP.Ext_layout_container_Anchor({"alternateClassNames":["Ext.layout.AnchorLayout"],"aliases":{"layout":["anchor"]},"enum":null,"parentMixins":["Ext.util.ElementContainer"],"tagname":"class","subclasses":["Ext.layout.container.Absolute"],"extends":"Ext.layout.container.Auto","uses":[],"html":"
Alternate names
Ext.layout.AnchorLayoutHierarchy
Ext.BaseExt.layout.LayoutExt.layout.container.ContainerExt.layout.container.AutoExt.layout.container.AnchorInherited mixins
Subclasses
Files
This is a layout that enables anchoring of contained elements relative to the container's dimensions.\nIf the container is resized, all anchored items are automatically rerendered according to their\nanchor
rules.
This class is intended to be extended or created via the layout: 'anchor'\nconfig, and should generally not need to be created directly via the new keyword.
\n\nAnchorLayout does not have any direct config options (other than inherited ones). By default,\nAnchorLayout will calculate anchor measurements based on the size of the container itself. However, the\ncontainer using the AnchorLayout can supply an anchoring-specific config property of anchorSize
.
If anchorSize is specifed, the layout will use it as a virtual container for the purposes of calculating\nanchor measurements based on it instead, allowing the container to be sized independently of the anchoring\nlogic if necessary.
\n\nExt.create('Ext.Panel', {\n width: 500,\n height: 400,\n title: \"AnchorLayout Panel\",\n layout: 'anchor',\n renderTo: Ext.getBody(),\n items: [\n {\n xtype: 'panel',\n title: '75% Width and 20% Height',\n anchor: '75% 20%'\n },\n {\n xtype: 'panel',\n title: 'Offset -300 Width & -200 Height',\n anchor: '-300 -200' \n },\n {\n xtype: 'panel',\n title: 'Mixed Offset and Percent',\n anchor: '-250 20%'\n }\n ]\n});\n
\nThis configuation option is to be applied to child items
of a container managed by\nthis layout (ie. configured with layout:'anchor'
).
This value is what tells the layout how an item should be anchored to the container. items
\nadded to an AnchorLayout accept an anchoring-specific config property of anchor which is a string\ncontaining two values: the horizontal anchor value and the vertical anchor value (for example, '100% 50%').\nThe following types of anchor values are supported:
Percentage : Any value between 1 and 100, expressed as a percentage.
\n\nThe first anchor is the percentage width that the item should take up within the container, and the\nsecond is the percentage height. For example:
\n\n// two values specified\nanchor: '100% 50%' // render item complete width of the container and\n // 1/2 height of the container\n// one value specified\nanchor: '100%' // the width value; the height will default to auto\n
Offsets : Any positive or negative integer value.
\n\nThis is a raw adjustment where the first anchor is the offset from the right edge of the container,\nand the second is the offset from the bottom edge. For example:
\n\n// two values specified\nanchor: '-50 -100' // render item the complete width of the container\n // minus 50 pixels and\n // the complete height minus 100 pixels.\n// one value specified\nanchor: '-50' // anchor value is assumed to be the right offset value\n // bottom offset will default to 0\n
Sides : Valid values are right
(or r
) and bottom
(or b
).
Either the container must have a fixed size or an anchorSize config value defined at render time in\norder for these to have any effect.
Mixed :
\n\nAnchor values can also be mixed as needed. For example, to render the width offset from the container\nright edge by 50 pixels and 75% of the container's height use:
\n\nanchor: '-50 75%'\n
Default anchor for all child container items applied if no anchor or specific width is set on the child item.
\nDefaults to: '100%'
An optional extra CSS class that will be added to the container. This can be useful for\nadding customized styles to the container or any of its children using standard CSS\nrules. See Ext.Component.componentCls also.
\nSet to true
to leave space for a vertical scrollbar (if the OS shows space-consuming scrollbars) regardless\nof whether a scrollbar is needed.
This is useful if content height changes during application usage, but you do not want the calculated width\nof child items to change when a scrollbar appears or disappears. The scrollbar will appear in the reserved space,\nand the calculated width of child Components will not change.
\n\nExt.define('Employee', {\n extend: 'Ext.data.Model',\n fields: [\n {name: 'rating', type: 'int'},\n {name: 'salary', type: 'float'},\n {name: 'name'}\n ]\n});\n\nfunction createFakeData(count) {\n var firstNames = ['Ed', 'Tommy', 'Aaron', 'Abe', 'Jamie', 'Adam', 'Dave', 'David', 'Jay', 'Nicolas', 'Nige'],\n lastNames = ['Spencer', 'Maintz', 'Conran', 'Elias', 'Avins', 'Mishcon', 'Kaneda', 'Davis', 'Robinson', 'Ferrero', 'White'],\n ratings = [1, 2, 3, 4, 5],\n salaries = [100, 400, 900, 1500, 1000000];\n\n var data = [];\n for (var i = 0; i < (count || 25); i++) {\n var ratingId = Math.floor(Math.random() * ratings.length),\n salaryId = Math.floor(Math.random() * salaries.length),\n firstNameId = Math.floor(Math.random() * firstNames.length),\n lastNameId = Math.floor(Math.random() * lastNames.length),\n\n rating = ratings[ratingId],\n salary = salaries[salaryId],\n name = Ext.String.format(\"{0} {1}\", firstNames[firstNameId], lastNames[lastNameId]);\n\n data.push({\n rating: rating,\n salary: salary,\n name: name\n });\n }\n store.loadData(data);\n}\n\n// create the Data Store\nvar store = Ext.create('Ext.data.Store', {\n id: 'store',\n model: 'Employee',\n proxy: {\n type: 'memory'\n }\n});\ncreateFakeData(10);\n\nvar grid = Ext.create('Ext.grid.Panel', {\n title: 'Grid loaded with varying number of records',\n anchor: '100%',\n store: store,\n columns: [{\n xtype: 'rownumberer',\n width: 40,\n sortable: false\n },{\n text: 'Name',\n flex: 1,\n sortable: true,\n dataIndex: 'name'\n },{\n text: 'Rating',\n width: 125,\n sortable: true,\n dataIndex: 'rating'\n },{\n text: 'Salary',\n width: 125,\n sortable: true,\n dataIndex: 'salary',\n align: 'right',\n renderer: Ext.util.Format.usMoney\n }]\n});\n\nExt.create('Ext.panel.Panel', {\n renderTo: document.body,\n width: 800,\n height: 600,\n layout: {\n type: 'anchor',\n reserveScrollbar: true // There will be a gap even when there's no scrollbar\n },\n autoScroll: true,\n items: grid,\n tbar: {\n defaults: {\n handler: function(b) {\n createFakeData(b.count);\n }\n },\n items: [{\n text: '10 Items',\n count: 10\n },{\n text: '100 Items',\n count: 100\n },{\n text: '300 Items',\n count: 300\n },{\n text: '1000 Items',\n count: 1000\n },{\n text: '5000 Items',\n count: 5000\n }]\n }\n});\n
\nDefaults to: false
An object which contains boolean properties specifying which properties are to be\nanimated upon flush of child Component ContextItems. For example, Accordion would\nhave:
\n\n {\n y: true,\n height: true\n }\n
\nDefaults to: {readsWidth: 1, readsHeight: 1, setsWidth: 0, setsHeight: 0}
Defaults to: ['outerCt', 'innerCt', 'clearEl']
Overrides: Ext.layout.container.Container.childEls
Used only during a layout run, this value indicates that a\nlayout has finished its calculations. This flag is set to true prior to the call to\ncalculate and should be set to false if this layout has more work to do.
\ntrue
in this class to identify an object as an instantiated Layout, or subclass thereof.
Defaults to: true
Begin with no previous adjustments
\nDefaults to: {width: 0, height: 0}
true to rerun the layout if scrollbars are needed.
\nDefaults to: true
Overrides: Ext.layout.container.Auto.manageOverflow
indicates that this layout will correct cross browser padding differences when the\ncontainer has overflow.
\n\nIn some browsers the right and/or bottom padding of a container is lost when\nthe container has overflow. If managePadding is true the layout will apply the\npadding to an inner wrapping element instead of the container element that has the\noverflow so that paddding will be included in the scrollable area.\nNote: padding will not be managed if it is configured on the container using\na style config or css class. In order to be managed, padding must be added to the\ncontainer using the appropriate contentPaddingProperty. For Panels use\nExt.panel.AbstractPanel.bodyPadding, and for\nContainers, use\npadding
\nDefaults to: true
The element used to correct body padding during overflow.
\nThe element used to correct body padding during overflow.
\nAuto layout's renderTpl wraps the content in an outerCt which is used to accomplish\nthe following 3 goals:
\n\nOverrides: Ext.layout.container.Container.renderTpl
Get the reference to the current class from which this object was instantiated. Unlike statics,\nthis.self
is scope-dependent and it's meant to be used for dynamic inheritance. See statics\nfor a detailed comparison
Ext.define('My.Cat', {\n statics: {\n speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n },\n\n constructor: function() {\n alert(this.self.speciesName); // dependent on 'this'\n },\n\n clone: function() {\n return new this.self();\n }\n});\n\n\nExt.define('My.SnowLeopard', {\n extend: 'My.Cat',\n statics: {\n speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'\n }\n});\n\nvar cat = new My.Cat(); // alerts 'Cat'\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'\n
\nDefaults to: {$: {readsWidth: 1, readsHeight: 1, setsWidth: 0, setsHeight: 0}, b: {readsWidth: 1, readsHeight: 0, setsWidth: 0, setsHeight: 1}, r: {$: {readsWidth: 0, readsHeight: 1, setsWidth: 1, setsHeight: 0}, b: {readsWidth: 0, readsHeight: 0, setsWidth: 1, setsHeight: 1}}}
This template is used for dynamically inserting a table outerCt/innerCt when needed.\nIt should be identical to the table template defined in renderTpl except that it\ndoes not have renderBody or clearEl. It is an empty shell so that the contents\nof an already existing innerCt can be moved into it.
\nAdds each argument passed to this method to the childEls array.
\nRemoves layout's itemCls and owning Container's itemCls.\nClears the managed dimensions flags
\nCalled by an owning Panel before the Panel begins its collapse process.\nMost layouts will not need to override the default Ext.emptyFn implementation.
\nCalled by an owning Panel before the Panel begins its expand process.\nMost layouts will not need to override the default Ext.emptyFn implementation.
\nIn addition to work done by our base classes, containers benefit from some extra\ncached data. The following properties are added to the ownerContext:
\n\nOverrides: Ext.layout.container.Container.beginLayout
Called before any calculation cycles to reset DOM values and prepare for calculation.
\n\nThis is a write phase and DOM reads should be strictly avoided when overridding\nthis method.
\nThe context item for the layout's owner\ncomponent.
\n\n\n\nOverrides: Ext.layout.container.Auto.beginLayoutCycle
Called to perform the calculations for this layout. This method will be called at\nleast once and may be called repeatedly if the done property is cleared\nbefore return to indicate that this layout is not yet done. The done property\nis always set to true
before entering this method.
This is a read phase and DOM writes should be strictly avoided in derived classes.\nInstead, DOM writes need to be written to Ext.layout.ContextItem objects to\n be flushed at the next opportunity.
\nThe context item for the layout's owner\ncomponent.
\n\nOverrides: Ext.layout.Layout.calculate
Handles overflow processing for a container. In addition to the ownerContext\npassed to the calculate method, this method also needs the containerSize\n(the object returned by getContainerSize).
\nCall the original method that was previously overridden with override
\n\nExt.define('My.Cat', {\n constructor: function() {\n alert(\"I'm a cat!\");\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n this.callOverridden();\n\n alert(\"Meeeeoooowwww\");\n }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n // alerts \"I'm a cat!\"\n // alerts \"Meeeeoooowwww\"\n
\n This method has been deprecated
\nas of 4.1. Use callParent instead.
\n\nThe arguments, either an array or the arguments
object\nfrom the current method, for example: this.callOverridden(arguments)
Returns the result of calling the overridden method
\nCall the \"parent\" method of the current method. That is the method previously\noverridden by derivation or by an override (see Ext.define).
\n\n Ext.define('My.Base', {\n constructor: function (x) {\n this.x = x;\n },\n\n statics: {\n method: function (x) {\n return x;\n }\n }\n });\n\n Ext.define('My.Derived', {\n extend: 'My.Base',\n\n constructor: function () {\n this.callParent([21]);\n }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x); // alerts 21\n
\n\nThis can be used with an override as follows:
\n\n Ext.define('My.DerivedOverride', {\n override: 'My.Derived',\n\n constructor: function (x) {\n this.callParent([x*2]); // calls original My.Derived constructor\n }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x); // now alerts 42\n
\n\nThis also works with static methods.
\n\n Ext.define('My.Derived2', {\n extend: 'My.Base',\n\n statics: {\n method: function (x) {\n return this.callParent([x*2]); // calls My.Base.method\n }\n }\n });\n\n alert(My.Base.method(10); // alerts 10\n alert(My.Derived2.method(10); // alerts 20\n
\n\nLastly, it also works with overridden static methods.
\n\n Ext.define('My.Derived2Override', {\n override: 'My.Derived2',\n\n statics: {\n method: function (x) {\n return this.callParent([x*2]); // calls My.Derived2.method\n }\n }\n });\n\n alert(My.Derived2.method(10); // now alerts 40\n
\n\nTo override a method and replace it and also call the superclass method, use\ncallSuper. This is often done to patch a method to fix a bug.
\nThe arguments, either an array or the arguments
object\nfrom the current method, for example: this.callParent(arguments)
Returns the result of calling the parent method
\nThis method is used by an override to call the superclass method but bypass any\noverridden method. This is often done to \"patch\" a method that contains a bug\nbut for whatever reason cannot be fixed directly.
\n\nConsider:
\n\n Ext.define('Ext.some.Class', {\n method: function () {\n console.log('Good');\n }\n });\n\n Ext.define('Ext.some.DerivedClass', {\n method: function () {\n console.log('Bad');\n\n // ... logic but with a bug ...\n\n this.callParent();\n }\n });\n
\n\nTo patch the bug in DerivedClass.method
, the typical solution is to create an\noverride:
Ext.define('App.paches.DerivedClass', {\n override: 'Ext.some.DerivedClass',\n\n method: function () {\n console.log('Fixed');\n\n // ... logic but with bug fixed ...\n\n this.callSuper();\n }\n });\n
\n\nThe patch method cannot use callParent
to call the superclass method
since\nthat would call the overridden method containing the bug. In other words, the\nabove patch would only produce \"Fixed\" then \"Good\" in the console log, whereas,\nusing callParent
would produce \"Fixed\" then \"Bad\" then \"Good\".
The arguments, either an array or the arguments
object\nfrom the current method, for example: this.callSuper(arguments)
Returns the result of calling the superclass method
\nThis method (if implemented) is called at the end of the cycle in which this layout\ncompletes (by not setting done to false
in calculate). It is\npossible for the layout to complete and yet become invalid before the end of the cycle,\nin which case, this method will not be called. It is also possible for this method to\nbe called and then later the layout becomes invalidated. This will result in\ncalculate being called again, followed by another call to this method.
This is a read phase and DOM writes should be strictly avoided in derived classes.\nInstead, DOM writes need to be written to Ext.layout.ContextItem objects to\nbe flushed at the next opportunity.
\n\nThis method need not be implemented by derived classes and, in fact, should only be\nimplemented when needed.
\nThe context item for the layout's owner\ncomponent.
\nOverrides: Ext.layout.Layout.completeLayout
Adds layout's itemCls and owning Container's itemCls
\nOverrides: Ext.layout.container.Container.configureItem
This method (if implemented) is called after all layouts have completed. In most\nways this is similar to completeLayout. This call can cause this (or any\nlayout) to be become invalid (see Ext.layout.Context.invalidate), but this\nis best avoided. This method is intended to be where final reads are made and so it\nis best to avoid invalidating layouts at this point whenever possible. Even so, this\nmethod can be used to perform final checks that may require all other layouts to be\ncomplete and then invalidate some results.
\n\nThis is a read phase and DOM writes should be strictly avoided in derived classes.\nInstead, DOM writes need to be written to Ext.layout.ContextItem objects to\nbe flushed at the next opportunity.
\n\nThis method need not be implemented by derived classes and, in fact, should only be\nimplemented when needed.
\nThe context item for the layout's owner\ncomponent.
\nThis method is called after all layouts are complete and their calculations flushed\nto the DOM. No further layouts will be run and this method is only called once per\nlayout run. The base component layout caches lastComponentSize
.
This is a write phase and DOM reads should be avoided if possible when overridding\nthis method.
\n\nThis method need not be implemented by derived classes and, in fact, should only be\nimplemented when needed.
\nThe context item for the layout's owner\ncomponent.
\n\nOverrides: Ext.layout.Layout.finishedLayout
Returns the container size (that of the target). Only the fixed-sized dimensions can\nbe returned because the shrinkWrap dimensions are based on the contentWidth/Height\nas determined by the container layout.
\n\nIf the calculateOverflow method is used and if manageOverflow is\ntrue, this will adjust the width/height by the size of scrollbars.
\nThe owner's context item.
\nTrue if the container size must be in the DOM.
\nDefaults to: false
Overridden method from Ext.layout.container.Container.\nUsed by Container classes to insert special DOM elements which must exist in addition to the child components
\n\nReturns the element into which extra functional DOM elements can be inserted. Defaults to the owner Component's encapsulating element.
\n\nMay be overridden in Component layout managers which implement a component render target which must only\ncontain child components.
\nReturns an object describing how this layout manages the size of the given component.\nThis method must be implemented by any layout that manages components.
\nAn object describing the sizing done by the layout\nfor this item.
\nOverrides: Ext.layout.Layout.getItemSizePolicy
Returns an array of child components either for a render phase (Performed in the beforeLayout\nmethod of the layout's base class), or the layout phase (onLayout).
\nof child components
\n\nOverrides: Ext.layout.Layout.getLayoutItems
Returns the overflow-x style of the render target.\nNote: If overflow is configured on a container using style or css class this method\nwill read the dom the first time it is called. It is therefore preferable for\nperformance reasons to use the autoScroll or overflowX config when horizontal\noverflow is desired.
\nReturns the overflow-y style of the render target.\nNote: If overflow is configured on a container using style or css class this method\nwill read the dom the first time it is called. It is therefore preferable for\nperformance reasons to use the autoScroll or overflowY config when vertical\noverflow is desired.
\nThis method is used to offset the DOM position when checking\nwhether the element is a certain child of the target. This is\nrequired in cases where the extra elements prepended to the target\nbefore any of the items. An example of this is when using labelAlign: 'top'\non a field. The label appears first in the DOM before any child items are\ncreated, so when we check the position we need to add an extra offset.\nContainers that create an innerCt are exempt because this new element\npreserves the order
\nOverrides: Ext.layout.Layout.getPositionOffset
Overridden method from Ext.layout.container.Container.\nUsed in the beforeLayout method to render all items into.
\n\nReturns the element into which rendering must take place. Defaults to the owner Container's\ntarget element.
\n\nMay be overridden in layout managers which implement an inner element.
\nInitialize configuration for this class. a typical example:
\n\nExt.define('My.awesome.Class', {\n // The default config\n config: {\n name: 'Awesome',\n isAwesome: true\n },\n\n constructor: function(config) {\n this.initConfig(config);\n }\n});\n\nvar awesome = new My.awesome.Class({\n name: 'Super Awesome'\n});\n\nalert(awesome.getName()); // 'Super Awesome'\n
\nthis
\nA one-time initialization method called just before rendering.
\nOverrides: Ext.layout.Layout.initLayout
In some cases a table-based outerCt/innerCt is required in old IE (see renderTpl).\nMost of the time this is determined at render time, however its possible that\nwe made the wrong determination at render time and now that the layout is in\nprogress we need a table. If so, this method should be called to replace the\nexisting outerCt with a new table outerCt, and move the child elements to the new\ninnerCt.
\nCalled for every layout in the layout context after all the layouts have been finally flushed
\nOverrides: Ext.layout.Layout.notifyOwner
This method is called when a child item changes in some way. By default this calls\nExt.AbstractComponent.updateLayout on this layout's owner.
\nThe child item that has changed.
\nTrue if this layout has handled the content change.
\nRemoves items in the childEls array based on the return value of a supplied test\nfunction. The function is called with a entry in childEls and if the test function\nreturn true, that entry is removed. If false, that entry is kept.
\nThe test function.
\nRenders the given Component into the target Element.
\nThe Component to render
\nThe target Element
\nThe position within the target to render the item to
\nThis method sets the height and/or width of the outerCt/innerCt to adjust for the\nfollowing browser-specific issues:
\n\nIn IE6 and 7 strict if we are using the shrink wrap template, and the outerCt\nhas a 100% width (because the container is not shrink wrapping width currently),\nand the target element has a vertical scrollbar, the browser disregards the\nscrollbar when sizing the width of the outerCt. This can result in the target\nelement gaining a horizontal scrollbar. We fix this issue by setting a pixel\nwidth on the outerCt
In IE quirks when using the \"non shrink wrap\" template, a long non-breaking word\ncan cause the outerCt's width to expand beyond the width of its container. This\nbehavior is desired if the container has the potential for horizontal overflow,\nbut can cause text to be hidden if the container's overflow is hidden. To prevent\nthis from happening we give the outerCt a fixed width in IE quirks when the\ncontainer does not have horizontal overflow.
In some browsers a percentage-height element ignores the horizontal scrollbar\nof its parent (see Ext.supports.PercentageHeightOverflowBug). If the browser is\naffected by this bug the outerCt needs a pixel height in order to support\npercentage-height children when not shrink-wrapping height. If the browser is not\naffected by this bug, a height of 100% is assigned to the outerCt (see\nbeginLayoutCycle).
In IE6/7 strict when using the \"shrink wrap\" template, percentage heights on\nchildren do not work unless the innerCt td has a height set. We can't use height\n100% on the innerCt because conent-box sizing will cause any top/bottom padding to\nbe added to the height. The solution is to set a pixel height on the innerCt.
IE8 strict mode has a bug with percentage height children. if the innerCt has\na height of 100%, has padding, and has a child item with a percentage height, that\nchild item will be sized as a percentage of the parent's height plus padding height.\nIn other words, a child with height:50% would have its height caclulated thusly:\n(parentHeight + parentPaddingHeight) * 0.5\nTo fix this, we have to give the innerCt a pixel height.
In IE7 strict if we're using the \"non shrink wrap\" template, and the target\nelement has overflow-y:auto, the outerCt reserves space for the target element's\nvertical scrollbar even when there is no vertical scrollbar. This is fixed by\nsetting the targetEl's overflow property to \"hidden\" and then back to \"auto\".
Get the reference to the class from which this object was instantiated. Note that unlike self,\nthis.statics()
is scope-independent and it always returns the class from which it was called, regardless of what\nthis
points to during run-time
Ext.define('My.Cat', {\n statics: {\n totalCreated: 0,\n speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n },\n\n constructor: function() {\n var statics = this.statics();\n\n alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to\n // equivalent to: My.Cat.speciesName\n\n alert(this.self.speciesName); // dependent on 'this'\n\n statics.totalCreated++;\n },\n\n clone: function() {\n var cloned = new this.self; // dependent on 'this'\n\n cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName\n\n return cloned;\n }\n});\n\n\nExt.define('My.SnowLeopard', {\n extend: 'My.Cat',\n\n statics: {\n speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'\n },\n\n constructor: function() {\n this.callParent();\n }\n});\n\nvar cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat'\n\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'\nalert(clone.groupName); // alerts 'Cat'\n\nalert(My.Cat.totalCreated); // alerts 3\n
\nAdd methods / properties to the prototype of this class.
\n\nExt.define('My.awesome.Cat', {\n constructor: function() {\n ...\n }\n});\n\n My.awesome.Cat.addMembers({\n meow: function() {\n alert('Meowww...');\n }\n });\n\n var kitty = new My.awesome.Cat;\n kitty.meow();\n
\nAdd / override static properties of this class.
\n\nExt.define('My.cool.Class', {\n ...\n});\n\nMy.cool.Class.addStatics({\n someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'\n method1: function() { ... }, // My.cool.Class.method1 = function() { ... };\n method2: function() { ... } // My.cool.Class.method2 = function() { ... };\n});\n
\nthis
\nBorrow another class' members to the prototype of this class.
\n\nExt.define('Bank', {\n money: '$$$',\n printMoney: function() {\n alert('$$$$$$$');\n }\n});\n\nExt.define('Thief', {\n ...\n});\n\nThief.borrow(Bank, ['money', 'printMoney']);\n\nvar steve = new Thief();\n\nalert(steve.money); // alerts '$$$'\nsteve.printMoney(); // alerts '$$$$$$$'\n
\nThe class to borrow members from
\nThe names of the members to borrow
\nthis
\nCreate a new instance of this Class.
\n\nExt.define('My.cool.Class', {\n ...\n});\n\nMy.cool.Class.create({\n someConfig: true\n});\n
\n\nAll parameters are passed to the constructor of the class.
\nthe created instance.
\nCreate aliases for existing prototype methods. Example:
\n\nExt.define('My.cool.Class', {\n method1: function() { ... },\n method2: function() { ... }\n});\n\nvar test = new My.cool.Class();\n\nMy.cool.Class.createAlias({\n method3: 'method1',\n method4: 'method2'\n});\n\ntest.method3(); // test.method1()\n\nMy.cool.Class.createAlias('method5', 'method3');\n\ntest.method5(); // test.method3() -> test.method1()\n
\nThe new method name, or an object to set multiple aliases. See\nflexSetter
\nThe original method name
\nGet the current class' name in string format.
\n\nExt.define('My.cool.Class', {\n constructor: function() {\n alert(this.self.getName()); // alerts 'My.cool.Class'\n }\n});\n\nMy.cool.Class.getName(); // 'My.cool.Class'\n
\nclassName
\nAdds members to class.
\nThis method has been deprecated since 4.1
\nUse addMembers instead.
\n\nOverride members of this class. Overridden methods can be invoked via\ncallParent.
\n\nExt.define('My.Cat', {\n constructor: function() {\n alert(\"I'm a cat!\");\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n this.callParent(arguments);\n\n alert(\"Meeeeoooowwww\");\n }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n // alerts \"I'm a cat!\"\n // alerts \"Meeeeoooowwww\"\n
\n\nAs of 4.1, direct use of this method is deprecated. Use Ext.define\ninstead:
\n\nExt.define('My.CatOverride', {\n override: 'My.Cat',\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n this.callParent(arguments);\n\n alert(\"Meeeeoooowwww\");\n }\n});\n
\n\nThe above accomplishes the same result but can be managed by the Ext.Loader\nwhich can properly order the override and its target class and the build process\ncan determine whether the override is needed based on the required state of the\ntarget class (My.Cat).
\nThis method has been deprecated since 4.1.0
\nUse Ext.define instead
\n\nThe properties to add to this class. This should be\nspecified as an object literal containing one or more properties.
\nthis class
\n