Ext.data.JsonP.Ext_layout_container_Border({"alternateClassNames":["Ext.layout.BorderLayout"],"aliases":{"layout":["border"]},"enum":null,"parentMixins":["Ext.util.ElementContainer"],"tagname":"class","subclasses":[],"extends":"Ext.layout.container.Container","uses":[],"html":"
Alternate names
Ext.layout.BorderLayoutHierarchy
Ext.BaseExt.layout.LayoutExt.layout.container.ContainerExt.layout.container.BorderInherited mixins
Requires
Ext.layout.container.border.RegionFiles
This is a multi-pane, application-oriented UI layout style that supports multiple nested panels, automatic bars\nbetween regions and built-in expanding and collapsing of regions.
\n\nThis class is intended to be extended or created via the layout:'border'
Ext.container.Container.layout\nconfig, and should generally not need to be created directly via the new keyword.
Ext.create('Ext.panel.Panel', {\n width: 500,\n height: 300,\n title: 'Border Layout',\n layout: 'border',\n items: [{\n title: 'South Region is resizable',\n region: 'south', // position for region\n xtype: 'panel',\n height: 100,\n split: true, // enable resizing\n margins: '0 5 5 5'\n },{\n // xtype: 'panel' implied by default\n title: 'West Region is collapsible',\n region:'west',\n xtype: 'panel',\n margins: '5 0 0 5',\n width: 200,\n collapsible: true, // make collapsible\n id: 'west-region-container',\n layout: 'fit'\n },{\n title: 'Center Region',\n region: 'center', // center region is required, no width/height specified\n xtype: 'panel',\n layout: 'fit',\n margins: '5 5 0 0'\n }],\n renderTo: Ext.getBody()\n});\n
\n\nWhen using the split option, the layout will automatically insert a Ext.resizer.Splitter\ninto the appropriate place. This will modify the underlying\nitems collection in the container.
Any Container using the Border layout must have a child item with region:'center'
.\nThe child item in the center region will always be resized to fill the remaining space\nnot used by the other regions in the layout.
Any child items with a region of west
or east
may be configured with either an initial\nwidth
, or a Ext.layout.container.Box.flex value, or an initial percentage width\nstring (Which is simply divided by 100 and used as a flex value).\nThe 'center' region has a flex value of 1
.
Any child items with a region of north
or south
may be configured with either an initial\nheight
, or a Ext.layout.container.Box.flex value, or an initial percentage height\nstring (Which is simply divided by 100 and used as a flex value).\nThe 'center' region has a flex value of 1
.
There is no BorderLayout.Region class in ExtJS 4.0+
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.
\nDefaults to: [Ext.baseCSSPrefix + 'border-item', Ext.baseCSSPrefix + 'box-item']
Overrides: Ext.layout.container.Container.itemCls
Sets the padding to be applied to all child items managed by this layout.
\n\nThis property can be specified as a string containing space-separated, numeric\npadding values. The order of the sides associated with each value matches the way\nCSS processes padding values:
\n\nThe default weights to assign to regions in the border layout. These values are\nused when a region does not contain a weight
property. This object must have\nproperties for all regions (\"north\", \"south\", \"east\" and \"west\").
IMPORTANT: Since this is an object, changing its properties will impact ALL\ninstances of Border layout. If this is not desired, provide a replacement object as\na config option instead:
\n\n layout: {\n type: 'border',\n regionWeights: {\n west: 20,\n north: 10,\n south: -10,\n east: -20\n }\n }\n
\n\nThe region with the highest weight is assigned space from the border before other\nregions. Regions of equal weight are assigned space based on their position in the\nowner's items list (first come, first served).
\nThis configuration option is to be applied to the child items
managed by this layout.\nEach region with split:true
will get a Splitter that\nallows for manual resizing of the container. Except for the center
region.
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}
Reused meta-data objects that describe axis properties.
\nDefaults to: {horz: {borderBegin: 'west', borderEnd: 'east', horizontal: true, posProp: 'x', sizeProp: 'width', sizePropCap: 'Width'}, vert: {borderBegin: 'north', borderEnd: 'south', horizontal: false, posProp: 'y', sizeProp: 'height', sizePropCap: 'Height'}}
Defaults to: ['overflowPadderEl']
Overrides: Ext.util.ElementContainer.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
The element used to correct body padding during overflow.
\nThe element used to correct body padding during overflow.
\nFlags and configs that get set of regions based on their region
property.
Defaults to: {center: {isCenter: true, isHorz: false, isVert: false}, north: {isCenter: false, isHorz: false, isVert: true, collapseDirection: 'top'}, south: {isCenter: false, isHorz: false, isVert: true, collapseDirection: 'bottom'}, west: {isCenter: false, isHorz: true, isVert: false, collapseDirection: 'left'}, east: {isCenter: false, isHorz: true, isVert: false, collapseDirection: 'right'}}
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: {vert: {readsWidth: 0, readsHeight: 1, setsWidth: 1, setsHeight: 0}, horz: {readsWidth: 1, readsHeight: 0, setsWidth: 0, setsHeight: 1}, flexAll: {readsWidth: 0, readsHeight: 0, setsWidth: 1, setsHeight: 1}}
Lists the regions that would consider an interior region a neighbor. For example,\na north region would consider an east or west region its neighbords (as well as\nan inner north region).
\nDefaults to: {center: ['north', 'south', 'east', 'west'], north: ['north', 'east', 'west'], south: ['south', 'east', 'west'], east: ['east', 'north', 'south'], west: ['west', 'north', 'south']}
Adds 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.Layout.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\n\n\nOverrides: Ext.layout.Layout.calculate
Call 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.
\nAdds layout's itemCls and owning Container's itemCls
\nOverrides: Ext.layout.Layout.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.
\nReturns 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.
\nThe owner's context item.
\nTrue if the container size must be in the DOM.
\nDefaults to: false
Returns 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
\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
Returns 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.
\nCalled for every layout in the layout context after all the layouts have been finally flushed
\nOverrides: Ext.layout.Layout.notifyOwner
Called when a region (actually when any component) is added to the container. The\nregion is decorated with some helpful properties (isCenter, isHorz, isVert) and its\nsplitter is added if its \"split\" property is true.
\nOverrides: Ext.layout.Layout.onAdd
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
\nGet 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