Ext.data.JsonP.Ext_layout_ContextItem({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.Base","uses":[],"html":"
Hierarchy
Ext.BaseExt.layout.ContextItemRequires
Files
NOTE This is a private utility class for internal use by the framework. Don't rely on its existence.
This class manages state information for a component or element during a layout.
\n\nA \"block\" is a required value that is preventing further calculation. When a layout has\nencountered a situation where it cannot possibly calculate results, it can associate\nitself with the context item and missing property so that it will not be rescheduled\nuntil that property is set.
\n\nBlocks are a one-shot registration. Once the property changes, the block is removed.
\n\nBe careful with blocks. If any further calculations can be made, a block is not the\nright choice.
\n\nWhenever any call to getProp, getDomProp, hasProp or\nhasDomProp is made, the current layout is automatically registered as being\ndependent on that property in the appropriate state. Any changes to the property will\ntrigger the layout and it will be queued in the Ext.layout.Context.
\n\nTriggers, once added, remain for the entire layout. Any changes to the property will\nreschedule all unfinished layouts in their trigger set.
\nDefaults to: ['border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width']
plaed here by AbstractComponent.getSizeModel
\nplaed here by AbstractComponent.getSizeModel
\nThe number of dirty properties
\nDefaults to: 0
Defaults to: ['margin-top', 'margin-right', 'margin-bottom', 'margin-left']
There are several cases that allow us to skip (opt out) of laying out a component\nand its children as long as its lastBox
is not marked as invalid
. If anything\nhappens to change things, the lastBox
is marked as invalid
by updateLayout
\nas it ascends the component hierarchy.
Defaults to: false
Defaults to: ['padding-top', 'padding-right', 'padding-bottom', 'padding-left']
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
\nState variables that are cleared when invalidated. Only applies to component items.
\nAdds x and y values from a props object to a styles object as \"left\" and \"top\" values.\nOverridden to add the x property as \"right\" in rtl mode. A styles object for an Element A ContextItem props object
\nTrue if this item wraps a Component (rather than an Element).
\nDefaults to: false
Adds a block.
\n\nOverridden in Ext.diag.layout.ContextItem.
\nThe name of the block list ('blocks' or 'domBlocks').
\nThe layout that is blocked.
\nThe property name that blocked the layout (e.g., 'width').
\nQueue the addition of a class name (or array of class names) to this ContextItem's target when next flushed.
\nRegisters a layout in the block list for the given property. Once the property is\nset in the Ext.layout.Context, the layout is unblocked.
\nThe property name that blocked the layout (e.g., 'width').
\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
\nRemoves any blocks on a property in the specified set. Any layouts that were blocked\nby this property and are not still blocked (by other properties) will be rescheduled.
\n\nOverridden in Ext.diag.layout.ContextItem.
\nclears the margin cache so that marginInfo get re-read from the dom on the next call to getMarginInfo()\nThis is needed in some special cases where the margins have changed since the last layout, making the cached\nvalues invalid. For example collapsed window headers have different margin than expanded ones.
\nRegisters a layout in the DOM block list for the given property. Once the property\nflushed to the DOM by the Ext.layout.Context, the layout is unblocked.
\nThe property name that blocked the layout (e.g., 'width').
\nFlushes any updates in the dirty collection to the DOM. This is only called if there\nare dirty entries because this object is only added to the flushQueue of the\nExt.layout.Context when entries become dirty.
\nGets the border information for the element as an object with left, top, right and\nbottom properties holding border size in pixels. This object is only read from the\nDOM on first request and is cached.
\nReturns a ClassList-like object to buffer access to this item's element's classes.
\nGets a property of this object if it is correct in the DOM. Also tracks the current\nlayout as dependent on this property so that DOM writes of it will trigger the\nlayout to be recalculated.
\nThe property name (e.g., 'width').
\nThe property value or undefined if not yet set or is dirty.
\nReturns the context item for an owned element. This should only be called on a\ncomponent's item. The list of child items is used to manage invalidating calculated\nresults.
\n\nOverridden in Ext.diag.layout.ContextItem.
\nThe element or the name of an owned element
\nThe owner of the\nnamed element if the passed \"nameOrEl\" parameter is a String. Defaults to this\nContextItem's \"target\" property. For more details on owned elements see\nchildEls and\nrenderSelectors
\nGets the \"frame\" information for the element as an object with left, top, right and\nbottom properties holding border+framing size in pixels. This object is calculated\non first request and is cached.
\nGets the margin information for the element as an object with left, top, right and\nbottom properties holding margin size in pixels. This object is only read from the\nDOM on first request and is cached.
\nGets the padding information for the element as an object with left, top, right and\nbottom properties holding padding size in pixels. This object is only read from the\nDOM on first request and is cached.
\nGets a property of this object. Also tracks the current layout as dependent on this\nproperty so that changes to it will trigger the layout to be recalculated.
\nThe property name that blocked the layout (e.g., 'width').
\nThe property value or undefined if not yet set.
\nReturns a style for this item. Each style is read from the DOM only once on first\nrequest and is then cached. If the value is an integer, it is parsed automatically\n(so '5px' is not returned, but rather 5).
\nThe CSS style name.
\nThe value of the DOM style (parsed as necessary).
\nReturns styles for this item. Each style is read from the DOM only once on first\nrequest and is then cached. If the value is an integer, it is parsed automatically\n(so '5px' is not returned, but rather 5).
\nThe CSS style names.
\nThe alternate names for the returned styles. If given,\nthese names must correspond one-for-one to the styleNames
.
The values of the DOM styles (parsed as necessary).
\nReturns true if the given property is correct in the DOM. This is equivalent to\ncalling getDomProp and not getting an undefined result. In particular,\nthis call registers the current layout to be triggered by flushes of this property.
\nThe property name (e.g., 'width').
\nReturns true if the given property has been set. This is equivalent to calling\ngetProp and not getting an undefined result. In particular, this call\nregisters the current layout to be triggered by changes to this property.
\nThe property name (e.g., 'width').
\nClears all properties on this object except (perhaps) those not calculated by this\ncomponent. This is more complex than it would seem because a layout can decide to\ninvalidate its results and run the component's layouts again, but since some of the\nvalues may be calculated by the container, care must be taken to preserve those\nvalues.
\n\nOverridden in Ext.diag.layout.ContextItem.
\nTrue if all properties are to be invalidated, false to keep\nthose calculated by the ownerCt.
\nA value to pass as the first argument to initContinue.
\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
\nInvalidates the component associated with this item. The layouts for this component\nand all of its contained items will be re-run after first clearing any computed\nvalues.
\n\nIf state needs to be carried forward beyond the invalidation, the options
parameter\ncan be used.
Overridden in Ext.diag.layout.ContextItem.
\nAn object describing how to handle the invalidation.
\nA function to call after the context data is cleared\nand before the Ext.layout.Layout.beginLayoutCycle methods are called.
\nThis ContextItem.
\nThe options object passed to invalidate.
\nA function to call after the context data is cleared\nand after the Ext.layout.Layout.beginLayoutCycle methods are called.
\nThis ContextItem.
\nThe options object passed to invalidate.
\nThe scope to use when calling the callback functions.
\nRecovers a property value from the last computation and restores its value and\ndirty state.
\nQueue the removal of a class name (or array of class names) from this ContextItem's target when next flushed.
\nRemoves a cached ContextItem that was created using getEl. It may be\nnecessary to call this method if the dom reference for owned element changes so\nthat getEl can be called again to reinitialize the ContextItem with the\nnew element.
\nThe element or the name of an owned element
\nThe owner of the\nnamed element if the passed \"nameOrEl\" parameter is a String. Defaults to this\nContextItem's \"target\" property.
\nSets the contentHeight property. If the component uses raw content, then only the\nmeasured height is acceptable.
\n\nCalculated values can sometimes be NaN or undefined, which generally mean the\ncalculation is not done. To indicate that such as value was passed, 0 is returned.\nOtherwise, 1 is returned.
\n\nIf the caller is not measuring (i.e., they are calculating) and the component has raw\ncontent, 1 is returned indicating that the caller is done.
\nSets the contentWidth and contentHeight properties. If the component uses raw content,\nthen only the measured values are acceptable.
\n\nCalculated values can sometimes be NaN or undefined, which generally means that the\ncalculation is not done. To indicate that either passed value was such a value, false\nreturned. Otherwise, true is returned.
\n\nIf the caller is not measuring (i.e., they are calculating) and the component has raw\ncontent, true is returned indicating that the caller is done.
\nSets the contentWidth property. If the component uses raw content, then only the\nmeasured width is acceptable.
\n\nCalculated values can sometimes be NaN or undefined, which generally means that the\ncalculation is not done. To indicate that such as value was passed, 0 is returned.\nOtherwise, 1 is returned.
\n\nIf the caller is not measuring (i.e., they are calculating) and the component has raw\ncontent, 1 is returned indicating that the caller is done.
\nSets the height and constrains the height to min/maxHeight range.
\n\nOverridden in Ext.diag.layout.ContextItem.
\nThe height.
\nSpecifies if the value is currently in the DOM. A\nvalue of false
indicates that the value is already in the DOM.
Defaults to: true
The actual height after constraining.
\nSets a property value. This will unblock and/or trigger dependent layouts if the\nproperty value is being changed. Values of NaN and undefined are not accepted by\nthis method.
\n\nOverridden in Ext.diag.layout.ContextItem.
\nThe property name (e.g., 'width').
\nThe new value of the property.
\nOptionally specifies if the value is currently in the DOM\n (default is true
which indicates the value is not in the DOM and must be flushed\n at some point).
1 if this call specified the property value, 0 if not.
\nSets the height and constrains the width to min/maxWidth range.
\n\nOverridden in Ext.diag.layout.ContextItem.
\nThe width.
\nSpecifies if the value is currently in the DOM. A\nvalue of false
indicates that the value is already in the DOM.
Defaults to: true
The actual width after constraining.
\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