EXT core API (1)

Source: Internet
Author: User

EXT class

Addbehaviors (Object OBJ): void

Apply the event listener to the selected element. The event name ends with @, for example

Addbehaviors ({

// Id = Add a click event to all a tags under foo

'# Foo A @ click': function (E, T ){

// Do something

},

// Use to separate multiple selectors

'# Foo A, # bar span. Some-class @ Mouseover': function (){

// Do something

}

});

Apply (Object OBJ, object config, object defaults): Object

Copy all attributes from config to OBJ. If the ults parameter exists, it also copies the attributes to OBJ.

Applyif (Object OBJ, object config): Object

Copy all attributes from config to OBJ (if OBJ does not define the corresponding attributes)

Decode (Object OBJ): String

Encode an object/array or other values as a JSON string (supported objects, arrays, dates, strings)

Destroy (mixed arg1, mixed (optional), mixed (optional): void

Try to remove each incoming object, including Dom, event listener, and call their destroy method (if any)

Each (array/nodelist/Mixed Array, function FN, object scope): void

Use each element in the array to call FN iteratively. Until FN returns false, call the format fn. Call (scope | array [I], array [I], I, array );

Encode (string JSON): Object

Deserializes a json string into an object

Escapere (string Str): String

For string regular encoding will. In * +? ^ $ {} () | [] // Prefix/

Extend (Object subclass, object superclass, [object overrides]): void

Inherit subclass from the superclass class. The overrides parameter is the list of methods to be overloaded. For details, see override.

Fly (string/htmlelement El, [String named]): Element

Get a global shared floating element El. If there are multiple floating elements, you can use the name to avoid potential conflicts.

Get (mixed El): Element

Obtain an element object. The parameter can be an ID, Dom node, or an existing element object.

Getbody (): Element

Get the body object of the current document

Getcmp (string ID): Component

Get a component object by ID

Getdoc (): Element

Obtain the current document

Getdom (mixed El): htmlelement

Returns a DOM node by ID, node, or element.

ID ([mixed El], [String prefix]): String

Generate a unique ID for the object El. If the object already has an ID, it will not be changed (you can use the prefix)

Isempty (mixed value, [Boolean allowblank]): Boolean

Determines whether the value is null, null, undefined, or Null String returns true. If allowblank is defined as true, the Null String is not considered null.

Namespace (string namespace1, string namespace2, string etc): void

Create a namespace, for example

Ext. namespace ('company', 'Company. data ');

Company. widget = function (){...}

Company. Data. customstore = function (config ){...}

Num (mixed value, number defaultvalue): Number

Convert value to a value. If value is not a valid value type, defaultvalue is returned. In fact, defaultvalue is not necessarily a value type, as long as you want

Onready (function FN, object scope, Boolean override): void

When the document is ready, the FN is triggered. It occurs before the onload event of the page, and the image is not loaded yet. The scope defines the owner, and the override defines whether the scope has the default choice.

Override (Object origclass, object overrides): void

Overrides is used to override origclass. For example

Ext. Override (myclass ,{

Newmethod1: function (){

// Etc.

},

Newmethod2: function (FOO ){

// Etc.

}

});

Query (string path, [node root]): Array

Select a node array from the root using path. path can be one of the following four selectors:

[Element selector] example:

* Any node

E: An e Tag Element

E f: F node whose ancestor node is E

E> f or F, where the parent node is E

E + F: F node where the first sibling node is E

E ~ In front of F, the sibling node has e's F node.

[Attribute selector] example:

E [Foo] e node with the foo attribute

E [Foo = bar] e node with the foo attribute value bar

E [Foo ^ = bar] e node whose Foo attribute starts with bar

E [Foo $ = bar] e node whose Foo attribute ends with bar

E [Foo * = bar] e node with bar strings in the foo attribute

E [Foo % = 2] e node whose Foo attribute can be divisible by 2

E [foo! = Bar] An e node whose Foo attribute value is not bar

[Pseudo-class selector] example:

E: First-Child e node is the first child node in the parent node

E: Last-Child e node is the last child node in the parent node.

E: Nth-child (n) e is every n nodes in the parent node.

E: Nth-child (ODD) E is an odd node in the parent node

E: Nth-child (even) E is the even number of nodes in the parent node.

E: Only-Child e is the only child node in the parent node.

E: The checked attribute is a real node.

E: The first e node in the first child node

E: The last e node in the last child node

E: the nth e node in the Nth (n) child node

E: Odd E: Nth-child (ODD)

E: Even E: Nth-child (even)

E: e node containing Foo in the contains (FOO) innerhtml attribute

E: nodevalue (FOO) e node contains a text node with the value of foo.

E: Not (s) does not match e node of simple selector s

E: e node of has (s) that can match child nodes of simple selector s

E: Next (s), the next sibling node matches the e node of the simple selector S.

E: Prev (s) the first sibling node matches the e node of the simple selector S.

Type (mixed object): String

Determines the object type. If it is not one of the following values, false is returned.

[Style selector] example:

E {display = none} an e node whose property value is none

E {display ^ = none} the value of the display attribute starts with none.

E {display $ = none} an e node whose property value ends with none

E {display * = none} the value of the display attribute contains the none substring of the e node.

E {display % = 2} an e node whose display property value can be divisible by 2

E {display! = None} the value of the display attribute is not equal to the value of the none node E.

Select (string/array selector, [Boolean unique], [htmlelement/string root]): compositeelementlite/compositeelement

In the root, select an element or element list through the style selector or element array selector. Unique indicates whether to select only unique values.

Urldecode (string, [Boolean overwrite]): Object

Decodes a string in the URL format as a JSON object. The overwrite parameter indicates whether the existing object is not overwritten. For example

Ext. urldecode ("foo = 1 & bar = 2"); // returns {FOO: 1, bar: 2}

Ext. urldecode ("foo = 1 & bar = 2 & bar = 3 & bar = 4"); // returns {FOO: 1, bar: 4 }.

Ext. urldecode ("foo = 1 & bar = 2 & bar = 3 & bar = 4", true); // returns {FOO: 1, bar: [2, 3, 4]}.

Urlencode (Object O): String

Encode a JSON object as a URL string. For more information, see urldecode.

Type (mixed object): String

Object type. If the value is not one of the following, false is returned.

String/number/Boolean/function/Object/array/Regexp/element/nodelist/textnode/whitespace

Author name: blackant2
Author blog: http://blog.csdn.net/blackant2

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.