Ext.data.JsonP.Ext_util_Positionable({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.Base","uses":[],"html":"

Hierarchy

Ext.Base
Ext.util.Positionable

Mixed into

Files

This mixin provides a common interface for objects that can be positioned, e.g.\nComponents and Elements

\n

Properties

Defined By

Instance Properties

...
\n

Defaults to: 'Ext.Base'

Ext.util.Positionable
view source
: RegExpprivate
...
\n

Defaults to: /^([a-z]+)-([a-z]+)(\\?)?$/

Ext.util.Positionable
view source
: Arrayprivate
...
\n

Defaults to: ['position', 'top', 'left']

...
\n

Defaults to: {}

Ext.util.Positionable
view source
: Objectprivate
By default this method does nothing but return the position spec passed to it. ...

By default this method does nothing but return the position spec passed to it. In\nrtl mode it is overridden to convert \"l\" to \"r\" and vice versa when required.

\n
...
\n

Defaults to: []

...
\n

Defaults to: {}

...
\n

Defaults to: true

Get the reference to the current class from which this object was instantiated. ...

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

\n\n
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
\n
Defined By

Static Properties

...
\n

Defaults to: []

Methods

Defined By

Instance Methods

Ext.util.Positionable
view source
( xy, parent )private
private ==> used outside of core\nTODO: currently only used by ToolTip. ...

private ==> used outside of core\nTODO: currently only used by ToolTip. does this method belong here?

\n

Parameters

Ext.util.Positionable
view source
( )private
Stub implementation called after positioning. ...

Stub implementation called after positioning.\nMay be implemented in subclasses. AbstractComponent has an implementation.

\n
Ext.util.Positionable
view source
( element, [position], [offsets], [animate] ) : Ext.util.Positionablechainable
Aligns the element with another element relative to the specified anchor points. ...

Aligns the element with another element relative to the specified anchor points. If\nthe other element is the document it aligns it to the viewport. The position\nparameter is optional, and can be specified in any one of the following formats:

\n\n
    \n
  • Blank: Defaults to aligning the element's top-left corner to the target's\nbottom-left corner (\"tl-bl\").
  • \n
  • One anchor (deprecated): The passed anchor position is used as the target\nelement's anchor point. The element being aligned will position its top-left\ncorner (tl) to that point. This method has been deprecated in favor of the newer\ntwo anchor syntax below.
  • \n
  • Two anchors: If two values from the table below are passed separated by a dash,\nthe first value is used as the element's anchor point, and the second value is\nused as the target's anchor point.
  • \n
\n\n\n

In addition to the anchor points, the position parameter also supports the \"?\"\ncharacter. If \"?\" is passed at the end of the position string, the element will\nattempt to align as specified, but the position will be adjusted to constrain to\nthe viewport if necessary. Note that the element being aligned might be swapped to\nalign to a different position than that specified in order to enforce the viewport\nconstraints. Following are all of the supported anchor positions:

\n\n
Value  Description\n-----  -----------------------------\ntl     The top left corner (default)\nt      The center of the top edge\ntr     The top right corner\nl      The center of the left edge\nc      In the center of the element\nr      The center of the right edge\nbl     The bottom left corner\nb      The center of the bottom edge\nbr     The bottom right corner\n
\n\n\n

Example Usage:

\n\n
// align el to other-el using the default positioning\n// (\"tl-bl\", non-constrained)\nel.alignTo(\"other-el\");\n\n// align the top left corner of el with the top right corner of other-el\n// (constrained to viewport)\nel.alignTo(\"other-el\", \"tr?\");\n\n// align the bottom right corner of el with the center left edge of other-el\nel.alignTo(\"other-el\", \"br-l?\");\n\n// align the center of el with the bottom left corner of other-el and\n// adjust the x position by -6 pixels (and the y position by 0)\nel.alignTo(\"other-el\", \"c-bl\", [-6, 0]);\n
\n

Parameters

  • element : Ext.util.Positionable/HTMLElement/String

    The Positionable,\nHTMLElement, or id of the element to align to.

    \n
  • position : String (optional)

    The position to align to

    \n

    Defaults to: "tl-bl?"

  • offsets : Number[] (optional)

    Offset the positioning by [x, y]

    \n
  • animate : Boolean/Object (optional)

    true for the default animation or a standard\nElement animation config object

    \n

Returns

Ext.util.Positionable
view source
( element, [position], [offsets], [animate], [monitorScroll], [callback] ) : Ext.util.Positionablechainable
Anchors an element to another element and realigns it when the window is resized. ...

Anchors an element to another element and realigns it when the window is resized.

\n

Parameters

  • element : Ext.util.Positionable/HTMLElement/String

    The Positionable,\nHTMLElement, or id of the element to align to.

    \n
  • position : String (optional)

    The position to align to

    \n

    Defaults to: "tl-bl?"

  • offsets : Number[] (optional)

    Offset the positioning by [x, y]

    \n
  • animate : Boolean/Object (optional)

    true for the default animation or a standard\nElement animation config object

    \n
  • monitorScroll : Boolean/Number (optional)

    True to monitor body scroll and\nreposition. If this parameter is a number, it is used as the buffer delay in\nmilliseconds.

    \n

    Defaults to: 50

  • callback : Function (optional)

    The function to call after the animation finishes

    \n

Returns

Ext.util.Positionable
view source
( [anchor], [extraX], [extraY], [size] ) : Number[]private
Calculates x,y coordinates specified by the anchor position on the element, adding\nextraX and extraY values. ...

Calculates x,y coordinates specified by the anchor position on the element, adding\nextraX and extraY values.

\n

Parameters

  • anchor : String (optional)

    The specified anchor position.\nSee alignTo for details on supported anchor positions.

    \n

    Defaults to: 'tl'

  • extraX : Number (optional)

    value to be added to the x coordinate

    \n
  • extraY : Number (optional)

    value to be added to the y coordinate

    \n
  • size : Object (optional)

    An object containing the size to use for calculating anchor\nposition {width: (target width), height: (target height)} (defaults to the\nelement's current size)

    \n

Returns

  • Number[]

    [x, y] An array containing the element's x and y coordinates

    \n
Ext.util.Positionable
view source
( [constrainTo], [proposedPosition], [local], [proposedSize] ) : Number[]
Calculates the new [x,y] position to move this Positionable into a constrain region. ...

Calculates the new [x,y] position to move this Positionable into a constrain region.

\n\n

By default, this Positionable is constrained to be within the container it was added to, or the element it was\nrendered to.

\n\n

Priority is given to constraining the top and left within the constraint.

\n\n

An alternative constraint may be passed.

\n

Parameters

  • constrainTo : String/HTMLElement/Ext.Element/Ext.util.Region (optional)

    The Element or Region\ninto which this Component is to be constrained. Defaults to the element into which this Positionable\nwas rendered, or this Component's {@link Ext.Component.constrainTo.

    \n
  • proposedPosition : Number[] (optional)

    A proposed [X, Y] position to test for validity\nand to coerce into constraints instead of using this Positionable's current position.

    \n
  • local : Boolean (optional)

    The proposedPosition is local (relative to floatParent if a floating Component)

    \n
  • proposedSize : Number[] (optional)

    A proposed [width, height] size to use when calculating\nconstraints instead of using this Positionable's current size.

    \n

Returns

  • Number[]

    If the element needs to be translated, the new [X, Y] position within\nconstraints if possible, giving priority to keeping the top and left edge in the constrain region.\nOtherwise, false.

    \n
( args ) : Objectdeprecatedprotected
Call the original method that was previously overridden with override\n\nExt.define('My.Cat', {\n constructor: functi...

Call the original method that was previously overridden with override

\n\n
Ext.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
\n

This method has been deprecated

\n

as of 4.1. Use callParent instead.

\n\n
\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callOverridden(arguments)

    \n

Returns

  • Object

    Returns the result of calling the overridden method

    \n
Call the \"parent\" method of the current method. ...

Call 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\n

This 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\n

This 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\n

Lastly, 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\n

To 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.

\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callParent(arguments)

    \n

Returns

  • Object

    Returns the result of calling the parent method

    \n
This method is used by an override to call the superclass method but bypass any\noverridden method. ...

This 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\n

Consider:

\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\n

To patch the bug in DerivedClass.method, the typical solution is to create an\noverride:

\n\n
 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\n

The 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\".

\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callSuper(arguments)

    \n

Returns

  • Object

    Returns the result of calling the superclass method

    \n
Ext.util.Positionable
view source
( element, [position], [offsets] ) : Number[]
Gets the x,y coordinates to align this element with another element. ...

Gets the x,y coordinates to align this element with another element. See\nalignTo for more info on the supported position values.

\n

Parameters

  • element : Ext.util.Positionable/HTMLElement/String

    The Positionable,\nHTMLElement, or id of the element to align to.

    \n
  • position : String (optional)

    The position to align to

    \n

    Defaults to: "tl-bl?"

  • offsets : Number[] (optional)

    Offset the positioning by [x, y]

    \n

Returns

Ext.util.Positionable
view source
( )private
private ...

private

\n
Ext.util.Positionable
view source
( el, [anchor], [local], [size] ) : Number[]private
Gets the x,y coordinates of an element specified by the anchor position on the\nelement. ...

Gets the x,y coordinates of an element specified by the anchor position on the\nelement.

\n

Parameters

  • el : Ext.dom.Element

    The element

    \n
  • anchor : String (optional)

    The specified anchor position.\nSee alignTo for details on supported anchor positions.

    \n

    Defaults to: 'tl'

  • local : Boolean (optional)

    True to get the local (element top/left-relative) anchor\nposition instead of page coordinates

    \n
  • size : Object (optional)

    An object containing the size to use for calculating anchor\nposition {width: (target width), height: (target height)} (defaults to the\nelement's current size)

    \n

Returns

  • Number[]

    [x, y] An array containing the element's x and y coordinates

    \n
Ext.util.Positionable
view source
( [anchor], [local], [size] ) : Number[]
Gets the x,y coordinates specified by the anchor position on the element. ...

Gets the x,y coordinates specified by the anchor position on the element.

\n

Parameters

  • anchor : String (optional)

    The specified anchor position.\nSee alignTo for details on supported anchor positions.

    \n

    Defaults to: 'tl'

  • local : Boolean (optional)

    True to get the local (element top/left-relative) anchor\nposition instead of page coordinates

    \n
  • size : Object (optional)

    An object containing the size to use for calculating anchor\nposition {width: (target width), height: (target height)} (defaults to the\nelement's current size)

    \n

Returns

  • Number[]

    [x, y] An array containing the element's x and y coordinates

    \n
Ext.util.Positionable
view source
( ) : Objectprivate
Returns the size of the element's borders and padding. ...

Returns the size of the element's borders and padding.

\n

Returns

  • Object

    an object with the following numeric properties\n- beforeX\n- afterX\n- beforeY\n- afterY

    \n
Ext.util.Positionable
view source
( [contentBox], [local] ) : Object
Return an object defining the area of this Element which can be passed to\nsetBox to set another Element's size/locati...

Return an object defining the area of this Element which can be passed to\nsetBox to set another Element's size/location to match this element.

\n

Parameters

  • contentBox : Boolean (optional)

    If true a box for the content of the element is\nreturned.

    \n
  • local : Boolean (optional)

    If true the element's left and top relative to its\noffsetParent are returned instead of page x/y.

    \n

Returns

  • Object

    box An object in the format:

    \n\n
    {\n    x: <Element's X position>,\n    y: <Element's Y position>,\n    left: <Element's X position (an alias for x)>,\n    top: <Element's Y position (an alias for y)>,\n    width: <Element's width>,\n    height: <Element's height>,\n    bottom: <Element's lower bound>,\n    right: <Element's rightmost bound>\n}\n
    \n\n

    The returned object may also be addressed as an Array where index 0 contains the X\nposition and index 1 contains the Y position. The result may also be used for\nsetXY

    \n
...
\n

Parameters

Ext.util.Positionable
view source
( [constrainTo], [proposedPosition], [proposedSize] ) : Number[]/Boolean
Returns the [X, Y] vector by which this Positionable's element must be translated to make a best\nattempt to constrain...

Returns the [X, Y] vector by which this Positionable's element must be translated to make a best\nattempt to constrain within the passed constraint. Returns false if the element\ndoes not need to be moved.

\n\n

Priority is given to constraining the top and left within the constraint.

\n\n

The constraint may either be an existing element into which the element is to be\nconstrained, or a Region into which this element is to be\nconstrained.

\n\n

By default, any extra shadow around the element is not included in the constrain calculations - the edges\nof the element are used as the element bounds. To constrain the shadow within the constrain region, set the\nconstrainShadow property on this element to true.

\n

Parameters

  • constrainTo : Ext.util.Positionable/HTMLElement/String/Ext.util.Region (optional)

    The\nPositionable, HTMLElement, element id, or Region into which the element is to be\nconstrained.

    \n
  • proposedPosition : Number[] (optional)

    A proposed [X, Y] position to test for validity\nand to produce a vector for instead of using the element's current position

    \n
  • proposedSize : Number[] (optional)

    A proposed [width, height] size to constrain\ninstead of using the element's current size

    \n

Returns

  • Number[]/Boolean

    If the element needs to be translated, an [X, Y]\nvector by which this element must be translated. Otherwise, false.

    \n
Returns the initial configuration passed to constructor when instantiating\nthis class. ...

Returns the initial configuration passed to constructor when instantiating\nthis class.

\n

Parameters

  • name : String (optional)

    Name of the config option to return.

    \n

Returns

  • Object/Mixed

    The full config object or a single config value\nwhen name parameter specified.

    \n
Ext.util.Positionable
view source
( ) : Number
Returns the x coordinate of this element reletive to its offsetParent. ...

Returns the x coordinate of this element reletive to its offsetParent.

\n

Returns

  • Number

    The local x coordinate

    \n
Ext.util.Positionable
view source
( ) : Number[]
Returns the x and y coordinates of this element relative to its offsetParent. ...

Returns the x and y coordinates of this element relative to its offsetParent.

\n

Returns

  • Number[]

    The local XY position of the element

    \n
Ext.util.Positionable
view source
( ) : Number
Returns the y coordinate of this element reletive to its offsetParent. ...

Returns the y coordinate of this element reletive to its offsetParent.

\n

Returns

  • Number

    The local y coordinate

    \n
Ext.util.Positionable
view source
( offsetsTo ) : Number[]
Returns the offsets of this element from the passed element. ...

Returns the offsets of this element from the passed element. The element must both\nbe part of the DOM tree and not have display:none to have page coordinates.

\n

Parameters

Returns

  • Number[]

    The XY page offsets (e.g. [100, -200])

    \n
Ext.util.Positionable
view source
( ) : Ext.util.Region
Returns a region object that defines the area of this element. ...

Returns a region object that defines the area of this element.

\n

Returns

  • Ext.util.Region

    A Region containing \"top, left, bottom, right\" properties.

    \n
Ext.util.Positionable
view source
( ) : Ext.util.Region
Returns the content region of this element. ...

Returns the content region of this element. That is the region within the borders\nand padding.

\n

Returns

  • Ext.util.Region

    A Region containing \"top, left, bottom, right\" member data.

    \n
Ext.util.Positionable
view source
( ) : Number
Gets the current X position of the DOM element based on page coordinates. ...

Gets the current X position of the DOM element based on page coordinates.

\n

Returns

  • Number

    The X position of the element

    \n
Ext.util.Positionable
view source
( ) : Number[]
Gets the current position of the DOM element based on page coordinates. ...

Gets the current position of the DOM element based on page coordinates.

\n

Returns

  • Number[]

    The XY position of the element

    \n
Ext.util.Positionable
view source
( ) : Number
Gets the current Y position of the DOM element based on page coordinates. ...

Gets the current Y position of the DOM element based on page coordinates.

\n

Returns

  • Number

    The Y position of the element

    \n
...
\n

Parameters

( config ) : Ext.Basechainableprotected
Initialize configuration for this class. ...

Initialize configuration for this class. a typical example:

\n\n
Ext.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
\n

Parameters

Returns

Ext.util.Positionable
view source
( direction, distance, [animate] )
Move the element relative to its current position. ...

Move the element relative to its current position.

\n

Parameters

  • direction : String

    Possible values are:

    \n\n
      \n
    • \"l\" (or \"left\")
    • \n
    • \"r\" (or \"right\")
    • \n
    • \"t\" (or \"top\", or \"up\")
    • \n
    • \"b\" (or \"bottom\", or \"down\")
    • \n
    \n\n
  • distance : Number

    How far to move the element in pixels

    \n
  • animate : Boolean/Object (optional)

    true for the default animation or a standard\nElement animation config object

    \n
( names, callback, scope )private
...
\n

Parameters

Ext.util.Positionable
view source
( ) : Ext.util.Positionablechainable
Remove any anchor to this element. ...

Remove any anchor to this element. See anchorTo.

\n

Returns

Ext.util.Positionable
view source
( box, [animate] ) : Ext.util.Positionablechainable
Sets the element's box. ...

Sets the element's box. If animate is true then x, y, width, and height will be\nanimated concurrently.

\n

Parameters

  • box : Object

    The box to fill {x, y, width, height}

    \n
  • animate : Boolean/Object (optional)

    true for the default animation or a standard\nElement animation config object

    \n

Returns

( config, applyIfNotSet ) : Ext.Basechainableprivate
...
\n

Parameters

Returns

Ext.util.Positionable
view source
( x ) : Ext.util.Positionablechainable
Sets the local x coordinate of this element using CSS style. ...

Sets the local x coordinate of this element using CSS style. When used on an\nabsolute positioned element this method is symmetrical with getLocalX, but\nmay not be symmetrical when used on a relatively positioned element.

\n

Parameters

  • x : Number

    The x coordinate. A value of null sets the left style to 'auto'.

    \n

Returns

Ext.util.Positionable
view source
( x, [y] ) : Ext.util.Positionablechainable
Sets the local x and y coordinates of this element using CSS style. ...

Sets the local x and y coordinates of this element using CSS style. When used on an\nabsolute positioned element this method is symmetrical with getLocalXY, but\nmay not be symmetrical when used on a relatively positioned element.

\n

Parameters

  • x : Number/Array

    The x coordinate or an array containing [x, y]. A value of\nnull sets the left style to 'auto'

    \n
  • y : Number (optional)

    The y coordinate, required if x is not an array. A value of\nnull sets the top style to 'auto'

    \n

Returns

Ext.util.Positionable
view source
( y ) : Ext.util.Positionablechainable
Sets the local y coordinate of this element using CSS style. ...

Sets the local y coordinate of this element using CSS style. When used on an\nabsolute positioned element this method is symmetrical with getLocalY, but\nmay not be symmetrical when used on a relatively positioned element.

\n

Parameters

  • y : Number

    The y coordinate. A value of null sets the top style to 'auto'.

    \n

Returns

Ext.util.Positionable
view source
( region, [animate] ) : Ext.util.Positionablechainable
Sets the element's position and size to the specified region. ...

Sets the element's position and size to the specified region. If animation is true\nthen width, height, x and y will be animated concurrently.

\n

Parameters

  • region : Ext.util.Region

    The region to fill

    \n
  • animate : Boolean/Object (optional)

    true for the default animation or a standard\nElement animation config object

    \n

Returns

Ext.util.Positionable
view source
( The, [animate] ) : Ext.util.Positionablechainable
Sets the X position of the DOM element based on page coordinates. ...

Sets the X position of the DOM element based on page coordinates.

\n

Parameters

  • The : Number

    X position

    \n
  • animate : Boolean/Object (optional)

    True for the default animation, or a standard\nElement animation config object

    \n

Returns

Ext.util.Positionable
view source
( pos, [animate] ) : Ext.util.Positionablechainable
Sets the position of the DOM element in page coordinates. ...

Sets the position of the DOM element in page coordinates.

\n

Parameters

  • pos : Number[]

    Contains X & Y [x, y] values for new position (coordinates\nare page-based)

    \n
  • animate : Boolean/Object (optional)

    True for the default animation, or a standard\nElement animation config object

    \n

Returns

Ext.util.Positionable
view source
( The, [animate] ) : Ext.util.Positionablechainable
Sets the Y position of the DOM element based on page coordinates. ...

Sets the Y position of the DOM element based on page coordinates.

\n

Parameters

  • The : Number

    Y position

    \n
  • animate : Boolean/Object (optional)

    True for the default animation, or a standard\nElement animation config object

    \n

Returns

Get the reference to the class from which this object was instantiated. ...

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

\n\n
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
\n

Returns

Ext.util.Positionable
view source
( x, [y] ) : Object
Translates the passed page coordinates into left/top css values for the element ...

Translates the passed page coordinates into left/top css values for the element

\n

Parameters

  • x : Number/Array

    The page x or an array containing [x, y]

    \n
  • y : Number (optional)

    The page y, required if x is not an array

    \n

Returns

  • Object

    An object with left and top properties. e.g.\n{left: (value), top: (value)}

    \n
Ext.util.Positionable
view source
( x, [y] ) : Objectprivate
Translates the passed page coordinates into x and y css values for the element ...

Translates the passed page coordinates into x and y css values for the element

\n

Parameters

  • x : Number/Array

    The page x or an array containing [x, y]

    \n
  • y : Number (optional)

    The page y, required if x is not an array

    \n

Returns

  • Object

    An object with x and y properties. e.g.\n{x: (value), y: (value)}

    \n
Defined By

Static Methods

( config )privatestatic
...
\n

Parameters

( members )chainableprivatestatic
...
\n

Parameters

( name, member )chainableprivatestatic
...
\n

Parameters

( members )chainablestatic
Add methods / properties to the prototype of this class. ...

Add methods / properties to the prototype of this class.

\n\n
Ext.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
\n

Parameters

( members ) : Ext.Basechainablestatic
Add / override static properties of this class. ...

Add / override static properties of this class.

\n\n
Ext.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
\n

Parameters

Returns

( xtype )chainableprivatestatic
...
\n

Parameters

( fromClass, members ) : Ext.Basechainableprivatestatic
Borrow another class' members to the prototype of this class. ...

Borrow another class' members to the prototype of this class.

\n\n
Ext.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
\n

Parameters

  • fromClass : Ext.Base

    The class to borrow members from

    \n
  • members : Array/String

    The names of the members to borrow

    \n

Returns

Create a new instance of this Class. ...

Create a new instance of this Class.

\n\n
Ext.define('My.cool.Class', {\n    ...\n});\n\nMy.cool.Class.create({\n    someConfig: true\n});\n
\n\n

All parameters are passed to the constructor of the class.

\n

Returns

( alias, origin )static
Create aliases for existing prototype methods. ...

Create aliases for existing prototype methods. Example:

\n\n
Ext.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
\n

Parameters

( config )privatestatic
...
\n

Parameters

Get the current class' name in string format. ...

Get the current class' name in string format.

\n\n
Ext.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
\n

Returns

( )deprecatedstatic
Adds members to class. ...

Adds members to class.

\n
\n

This method has been deprecated since 4.1

\n

Use addMembers instead.

\n\n
\n
( name, mixinClass )privatestatic
Used internally by the mixins pre-processor ...

Used internally by the mixins pre-processor

\n

Parameters

( fn, scope )chainableprivatestatic
...
\n

Parameters

( members ) : Ext.Basechainabledeprecatedstatic
Override members of this class. ...

Override members of this class. Overridden methods can be invoked via\ncallParent.

\n\n
Ext.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\n

As of 4.1, direct use of this method is deprecated. Use Ext.define\ninstead:

\n\n
Ext.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\n

The 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).

\n
\n

This method has been deprecated since 4.1.0

\n

Use Ext.define instead

\n\n
\n

Parameters

  • members : Object

    The properties to add to this class. This should be\nspecified as an object literal containing one or more properties.

    \n

Returns

","superclasses":["Ext.Base"],"meta":{},"code_type":"ext_define","requires":[],"html_meta":{},"statics":{"property":[{"tagname":"property","owner":"Ext.Base","meta":{"static":true,"private":true},"name":"$onExtended","id":"static-property-S-onExtended"}],"cfg":[],"css_var":[],"method":[{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"private":true},"name":"addConfig","id":"static-method-addConfig"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"private":true},"name":"addInheritableStatics","id":"static-method-addInheritableStatics"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"private":true},"name":"addMember","id":"static-method-addMember"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true},"name":"addMembers","id":"static-method-addMembers"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true},"name":"addStatics","id":"static-method-addStatics"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"private":true},"name":"addXtype","id":"static-method-addXtype"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"private":true},"name":"borrow","id":"static-method-borrow"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true},"name":"create","id":"static-method-create"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true},"name":"createAlias","id":"static-method-createAlias"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"private":true},"name":"extend","id":"static-method-extend"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true},"name":"getName","id":"static-method-getName"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"deprecated":{"text":"Use {@link #addMembers} instead.","version":"4.1"}},"name":"implement","id":"static-method-implement"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"private":true},"name":"mixin","id":"static-method-mixin"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"private":true},"name":"onExtended","id":"static-method-onExtended"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"markdown":true,"deprecated":{"text":"Use {@link Ext#define Ext.define} instead","version":"4.1.0"}},"name":"override","id":"static-method-override"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"private":true},"name":"triggerExtended","id":"static-method-triggerExtended"}],"event":[],"css_mixin":[]},"files":[{"href":"Positionable.html#Ext-util-Positionable","filename":"Positionable.js"}],"linenr":2,"members":{"property":[{"tagname":"property","owner":"Ext.Base","meta":{"private":true},"name":"$className","id":"property-S-className"},{"tagname":"property","owner":"Ext.util.Positionable","meta":{"private":true},"name":"_alignRe","id":"property-_alignRe"},{"tagname":"property","owner":"Ext.util.Positionable","meta":{"private":true},"name":"_positionTopLeft","id":"property-_positionTopLeft"},{"tagname":"property","owner":"Ext.Base","meta":{"private":true},"name":"configMap","id":"property-configMap"},{"tagname":"property","owner":"Ext.util.Positionable","meta":{"private":true},"name":"convertPositionSpec","id":"property-convertPositionSpec"},{"tagname":"property","owner":"Ext.Base","meta":{"private":true},"name":"initConfigList","id":"property-initConfigList"},{"tagname":"property","owner":"Ext.Base","meta":{"private":true},"name":"initConfigMap","id":"property-initConfigMap"},{"tagname":"property","owner":"Ext.Base","meta":{"private":true},"name":"isInstance","id":"property-isInstance"},{"tagname":"property","owner":"Ext.Base","meta":{"protected":true},"name":"self","id":"property-self"}],"cfg":[],"css_var":[],"method":[{"tagname":"method","owner":"Ext.util.Positionable","meta":{"private":true},"name":"adjustForConstraints","id":"method-adjustForConstraints"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"private":true},"name":"afterSetPosition","id":"method-afterSetPosition"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"alignTo","id":"method-alignTo"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"anchorTo","id":"method-anchorTo"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"private":true},"name":"calculateAnchorXY","id":"method-calculateAnchorXY"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"calculateConstrainedPosition","id":"method-calculateConstrainedPosition"},{"tagname":"method","owner":"Ext.Base","meta":{"protected":true,"deprecated":{"text":"as of 4.1. Use {@link #callParent} instead."}},"name":"callOverridden","id":"method-callOverridden"},{"tagname":"method","owner":"Ext.Base","meta":{"protected":true},"name":"callParent","id":"method-callParent"},{"tagname":"method","owner":"Ext.Base","meta":{"protected":true},"name":"callSuper","id":"method-callSuper"},{"tagname":"method","owner":"Ext.Base","meta":{"private":true},"name":"configClass","id":"method-configClass"},{"tagname":"method","owner":"Ext.Base","meta":{"private":true},"name":"destroy","id":"method-destroy"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getAlignToXY","id":"method-getAlignToXY"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"private":true},"name":"getAnchor","id":"method-getAnchor"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"private":true},"name":"getAnchorToXY","id":"method-getAnchorToXY"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getAnchorXY","id":"method-getAnchorXY"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"private":true},"name":"getBorderPadding","id":"method-getBorderPadding"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getBox","id":"method-getBox"},{"tagname":"method","owner":"Ext.Base","meta":{"private":true},"name":"getConfig","id":"method-getConfig"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getConstrainVector","id":"method-getConstrainVector"},{"tagname":"method","owner":"Ext.Base","meta":{},"name":"getInitialConfig","id":"method-getInitialConfig"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getLocalX","id":"method-getLocalX"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getLocalXY","id":"method-getLocalXY"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getLocalY","id":"method-getLocalY"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getOffsetsTo","id":"method-getOffsetsTo"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getRegion","id":"method-getRegion"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getViewRegion","id":"method-getViewRegion"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getX","id":"method-getX"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getXY","id":"method-getXY"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"getY","id":"method-getY"},{"tagname":"method","owner":"Ext.Base","meta":{"private":true},"name":"hasConfig","id":"method-hasConfig"},{"tagname":"method","owner":"Ext.Base","meta":{"chainable":true,"protected":true},"name":"initConfig","id":"method-initConfig"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"move","id":"method-move"},{"tagname":"method","owner":"Ext.Base","meta":{"private":true},"name":"onConfigUpdate","id":"method-onConfigUpdate"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"removeAnchor","id":"method-removeAnchor"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"setBox","id":"method-setBox"},{"tagname":"method","owner":"Ext.Base","meta":{"chainable":true,"private":true},"name":"setConfig","id":"method-setConfig"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"setLocalX","id":"method-setLocalX"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"setLocalXY","id":"method-setLocalXY"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"setLocalY","id":"method-setLocalY"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"setRegion","id":"method-setRegion"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"setX","id":"method-setX"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"setXY","id":"method-setXY"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"chainable":true},"name":"setY","id":"method-setY"},{"tagname":"method","owner":"Ext.Base","meta":{"protected":true},"name":"statics","id":"method-statics"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{},"name":"translatePoints","id":"method-translatePoints"},{"tagname":"method","owner":"Ext.util.Positionable","meta":{"private":true},"name":"translateXY","id":"method-translateXY"}],"event":[],"css_mixin":[]},"inheritable":null,"private":null,"component":false,"name":"Ext.util.Positionable","singleton":false,"override":null,"inheritdoc":null,"id":"class-Ext.util.Positionable","mixins":[],"mixedInto":["Ext.AbstractComponent"]});