Ext core utilities and functions.
This class is a singleton and cannot be created directly.
|
addBehaviors( Object obj ) : void |
Ext |
Applies event listeners to elements by selectors when the document is ready.
The event name is specified with an @ su... |
|
apply( Object obj , Object config , Object defaults ) : Object |
Ext |
Copies all the properties of config to obj. |
|
applyIf( Object obj , Object config ) : Object |
Ext |
Copies all the properties of config to obj if they don't already exist. |
|
decode() : void |
Ext |
Shorthand for Ext.util.JSON.decode |
|
each( Array/NodeList/Mixed array , Function fn , Object scope ) : void |
Ext |
Iterates an array calling the passed function with each item, stopping if your function returns false. If the
passed ... |
|
encode() : void |
Ext |
Shorthand for Ext.util.JSON.encode |
|
escapeRe( String str ) : String |
Ext |
Escapes the passed string for use in a regular expression |
|
extend( Object subclass , Object superclass , [Object overrides ] ) : void |
Ext |
Extends one class with another class and optionally overrides members with the passed literal. This class
also adds t... |
|
fly( String/HTMLElement el , [String named ] ) : Element |
Ext |
<static> Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a... |
|
get( String/HTMLElement/Element el ) : Element |
Ext |
Static method to retrieve Element objects. Uses simple caching to consistently return the same object.
Automatically ... |
|
getCmp( String id ) : Ext.Component |
Ext |
Shorthand for Ext.ComponentMgr.get |
|
getDom( String/HTMLElement/Ext.Element el ) : HTMLElement |
Ext |
Return the dom node for the passed string (id), dom node, or Ext.Element |
|
id( [String/HTMLElement/Element el ], [String prefix ] ) : String |
Ext |
Generates unique ids. If the element already has an id, it is unchanged |
|
isEmpty( Mixed value , [Boolean allowBlank ] ) : Boolean |
Ext |
Returns true if the passed value is null, undefined or an empty string (optional). |
|
namespace( String namespace1 , String namespace2 , String etc ) : void |
Ext |
Creates namespaces to be used for scoping variables and classes so that they are not global. Usage:
Ext.namespace('C... |
|
onReady( Function fn , Object scope , boolean override ) : void |
Ext |
Fires when the document is ready (before onload and before images are loaded). Shorthand of Ext.EventManager.onDocum... |
|
override( Object origclass , Object overrides ) : void |
Ext |
Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.
... |
|
query( String path , [Node root ] ) : Array |
Ext |
Selects an array of DOM nodes by CSS/XPath selector. Shorthand of Ext.DomQuery.select |
|
select( String/Array selector , [Boolean unique ], [HTMLElement/String root ] ) : CompositeElementLite/CompositeElement |
Ext |
Selects elements based on the passed CSS selector to enable working on them as 1. |
|
type( Mixed object ) : String |
Ext |
Returns the type of object that is passed in. If the object passed in is null or undefined it
return false otherwise ... |
|
urlDecode( String string , [Boolean overwrite ] ) : Object |
Ext |
Takes an encoded URL and and converts it to an object. e.g. Ext.urlDecode("foo=1&bar=2"); would return {foo: 1, bar: ... |
|
urlEncode( Object o ) : String |
Ext |
Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". ... |
This class has no public events.
BLANK_IMAGE_URL
public String BLANK_IMAGE_URL
URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. (Defaults to
"http://extjs.com/s.gif" and you should change this to a URL on your server).
This property is defined by Ext.
SSL_SECURE_URL
public String SSL_SECURE_URL
URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent
the IE insecure content warning (defaults to javascript:false).
This property is defined by Ext.
enableGarbageCollector
public Boolean enableGarbageCollector
True to automatically uncache orphaned Ext.Elements periodically (defaults to true)
This property is defined by Ext.
enableListenerCollection
public Boolean enableListenerCollection
True to automatically purge event listeners after uncaching an element (defaults to false).
Note: this only happens if enableGarbageCollector is true.
This property is defined by Ext.
isBorderBox
public Boolean isBorderBox
This property is defined by Ext.
isGecko
public Boolean isGecko
This property is defined by Ext.
isIE
public Boolean isIE
This property is defined by Ext.
isIE7
public Boolean isIE7
This property is defined by Ext.
isLinux
public Boolean isLinux
This property is defined by Ext.
isMac
public Boolean isMac
This property is defined by Ext.
isOpera
public Boolean isOpera
This property is defined by Ext.
isReady
public Boolean isReady
True when the document is fully initialized and ready for action
This property is defined by Ext.
isSafari
public Boolean isSafari
This property is defined by Ext.
isSecure
public Boolean isSecure
True if the page is running over SSL
This property is defined by Ext.
isStrict
public Boolean isStrict
True if the browser is in strict mode
This property is defined by Ext.
isWindows
public Boolean isWindows
This property is defined by Ext.
useShims
public Boolean useShims
By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash,
you may want to set this to true.
This property is defined by Ext.
addBehaviors
public function addBehaviors( Object obj
)
Applies event listeners to elements by selectors when the document is ready.
The event name is specified with an @ suffix.
Ext.addBehaviors({
// add a listener for click on all anchors in element with id foo
'#foo a@click' : function(e, t){
// do something
},
// add the same listener to multiple selectors (separated by comma BEFORE the @)
'#foo a, #bar span.some-class@mouseover' : function(){
// do something
}
});
This method is defined by Ext.
apply
public function apply( Object obj
, Object config
, Object defaults
)
Copies all the properties of config to obj.
Parameters:
obj
: ObjectThe receiver of the properties
config
: ObjectThe source of the properties
defaults
: ObjectA different object that will also be applied for default values
Returns:
This method is defined by Ext.
applyIf
public function applyIf( Object obj
, Object config
)
Copies all the properties of config to obj if they don't already exist.
This method is defined by Ext.
decode
public function decode()
This method is defined by Ext.
each
public function each( Array/NodeList/Mixed array
, Function fn
, Object scope
)
Iterates an array calling the passed function with each item, stopping if your function returns false. If the
passed array is not really an array, your function is called once with it.
The supplied function is called with (Object item, Number index, Array allItems).
Parameters:
array
: Array/NodeList/Mixedfn
: Functionscope
: Object
Returns:
This method is defined by Ext.
encode
public function encode()
This method is defined by Ext.
escapeRe
public function escapeRe( String str
)
Escapes the passed string for use in a regular expression
This method is defined by Ext.
extend
public function extend( Object subclass
, Object superclass
, [Object overrides
] )
Extends one class with another class and optionally overrides members with the passed literal. This class
also adds the function "override()" to the class that can be used to override
members on an instance.
This method is defined by Ext.
fly
public function fly( String/HTMLElement el
, [String named
] )
<static> Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element -
the dom node can be overwritten by other code.
Shorthand of
Ext.Element.fly
This method is defined by Ext.
get
public function get( String/HTMLElement/Element el
)
Static method to retrieve Element objects. Uses simple caching to consistently return the same object.
Automatically fixes if an object was recreated with the same id via AJAX or DOM.
Shorthand of
Ext.Element.get
Parameters:
Returns:
Element
The Element object
This method is defined by Ext.
getCmp
public function getCmp( String id
)
This method is defined by Ext.
getDom
public function getDom( String/HTMLElement/Ext.Element el
)
Return the dom node for the passed string (id), dom node, or Ext.Element
Parameters:
el
: String/HTMLElement/Ext.Element
Returns:
This method is defined by Ext.
id
public function id( [String/HTMLElement/Element el
], [String prefix
] )
Generates unique ids. If the element already has an id, it is unchanged
This method is defined by Ext.
isEmpty
public function isEmpty( Mixed value
, [Boolean allowBlank
] )
Returns true if the passed value is null, undefined or an empty string (optional).
This method is defined by Ext.
namespace
public function namespace( String namespace1
, String namespace2
, String etc
)
Creates namespaces to be used for scoping variables and classes so that they are not global. Usage:
Ext.namespace('Company', 'Company.data');
Company.Widget = function() { ... }
Company.data.CustomStore = function(config) { ... }
Parameters:
namespace1
: Stringnamespace2
: Stringetc
: String
Returns:
This method is defined by Ext.
onReady
public function onReady( Function fn
, Object scope
, boolean override
)
Fires when the document is ready (before onload and before images are loaded). Shorthand of
Ext.EventManager.onDocumentReady.
Parameters:
fn
: FunctionThe method the event invokes
scope
: ObjectAn object that becomes the scope of the handler
override
: booleanIf true, the obj passed in becomes
the execution scope of the listener
Returns:
This method is defined by Ext.
override
public function override( Object origclass
, Object overrides
)
Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.
Usage:
Ext.override(MyClass, {
newMethod1: function(){
// etc.
},
newMethod2: function(foo){
// etc.
}
});
This method is defined by Ext.
query
public function query( String path
, [Node root
] )
This method is defined by Ext.
select
public function select( String/Array selector
, [Boolean unique
], [HTMLElement/String root
] )
Selects elements based on the passed CSS selector to enable working on them as 1.
Parameters:
selector
: String/ArrayThe CSS selector or an array of elements
unique
: Boolean(optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object)
root
: HTMLElement/String(optional) The root element of the query or id of the root
Returns:
CompositeElementLite/CompositeElement
This method is defined by Ext.
type
public function type( Mixed object
)
Returns the type of object that is passed in. If the object passed in is null or undefined it
return false otherwise it returns one of the following values:
- string: If the object passed is a string
- number: If the object passed is a number
- boolean: If the object passed is a boolean value
- function: If the object passed is a function reference
- object: If the object passed is an object
- array: If the object passed is an array
- regexp: If the object passed is a regular expression
- element: If the object passed is a DOM Element
- nodelist: If the object passed is a DOM NodeList
- textnode: If the object passed is a DOM text node and contains something other than whitespace
- whitespace: If the object passed is a DOM text node and contains only whitespace
This method is defined by Ext.
urlDecode
public function urlDecode( String string
, [Boolean overwrite
] )
Takes an encoded URL and and converts it to an object. e.g. Ext.urlDecode("foo=1&bar=2"); would return {foo: 1, bar: 2} or Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", true); would return {foo: 1, bar: [2, 3, 4]}.
Parameters:
Returns:
Object
A literal with members
This method is defined by Ext.
urlEncode
public function urlEncode( Object o
)
Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". Optionally, property values can be arrays, instead of keys and the resulting string that's returned will contain a name/value pair for each array value.
This method is defined by Ext.