EXTJS4 Learning (v) the most basic ext class

Source: Internet
Author: User

The Ext class is the most common and basic class in ExtJS, a global object that encapsulates the practical approach provided by all classes, Singleton, and Sencha libraries.


Most user interface components are nested in namespaces at a lower level, but many common utility functions are provided as direct properties of the Ext namespace.


There are also many common methods available, from other classes as shortcuts within the Ext namespace. For example, EXT.GETCMP is the alias of Ext.ComponentManager.get.


Once the DOM is ready, many applications start, calling Ext.onready. This ensures that all scripts are loaded to prevent dependency problems. For example:

Ext.onready (function () {    new ext.component ({        renderTo:document.body,        html: ' DOM ready! '    );});

1 apply( Object object, Object config, [object defaults] ) : Object

The parameter is a copy of the source object, and the third parameter is optional, indicating that a default value is provided to the target object. It can be simply understood to copy the third parameter (if any) and the property in the second argument to the first parameter object.

var animal ={name: ' Tome '}ext.apply (Animal,{age:12,run:function () {console.info (' Merry Running ')});
The final animal object will also have the Run method, Animal.run ();


2 Applyif( object object, Object config ): Object

Similar to apply, the only difference is that config no longer overwrites if the object has already owned a property or method


3 decode( String json, Boolean safe ): Object

The shorthand form of Ext.JSON.decode decodes (parses) a JSON string object. If JSON is not valid, this function throws a syntaxerror unless the security option is set.

var result = Ext.decode (' {success:true,msg:xxxx} '); Console.info (result.success)//true
4 each( array/nodelist/object iterable, Function FN, [Object scope], [Boolean reverse] ) : Boolean

Ext.each ([1,2,3,4,5,6],function (Item,index,allitems) {if (item<5) {return false;} Else{console.log (item);}});


5  fly (  string/htmlelement dom, [string named]  ):   Ext.dom.AbstractElement.Fly

Get( string/htmlelement/ext.element el ): Ext.dom.Element

GETCMP( String ID )

getdom (  string/htmlelement/ext.element el  )

query (  string path, [HtmlElement Root], [String type]  ): htmlelement[]

select (  string selector  ):   ext.compositeelement

Above in EXTJS4 study (ii): DOM operation has been introduced


6 isarray (  object target  ):   Boolean

Isboolean( Object value ): Boolean

IsDate( Object Object ): Boolean

Iselement (  object value  ):   Boolean

Isempty (  object value, boolean allowemptystring  ):   Boolean

Isfunction( Object value ): Boolean

Isiterable( Object value ): Boolean

Isnumber( Object value ): Boolean

IsNumeric( Object value ): Boolean

IsObject( Object value ): Boolean

Isprimitive( Object value ): Boolean

Isstring( Object value ): Boolean

Istextnode( Object value ): Boolean

The above basic is the object of judgment, you can refer to the API


7 namespace( String ... ): Object

Ext.namespace (' My.app.service '); my.app.service.name = ' Somnus '; my.app.service.say = function () {Console.info (' Hello ')}
8 NS( String ...) : Object

Shorthand form of namespace


EXTJS4 Learning (v) the most basic ext class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.