Introduction to ExtJS core functions
Common functions provided by 1.ExtJs
2.get, Fly, getcmp, GetDOM, GetBody, Getdoc
3.query functions and select functions
4.encode functions and Decode functions
5.ext.each function
6.ext.util.format to format data
7.ext.util.taskrunner
8.update method to partially update Web page content
Ext contains several methods that begin with get, which can be used to get the DOM in the document, to get the components in the current document, to get the ext element, etc., and to be aware of the difference in use.
1. Get method
The Get method is used to get an EXT element, which is an object of type ext.element,
The Ext.element class is an ext-dom wrapper that represents the elements of the DOM and can create a corresponding element object for each DOM.
You can use the method on the element object to implement the actions specified on the DOM, such as hiding an element with the Hide method
The INITDD method allows the specified DOM to have drag-and-drop characteristics, and so on. The Get method is actually a shorthand form of Ext.Element.get.
There is only one parameter in the Get method, which is a mixed parameter, which can be the ID of the DOM node, an element, or a DOM node object. Look at the following sample code:
Ext.onready (function () {
var e=new ext.element ("OA");
Alert (Ext.get ("OA"));
Alert (Ext.get (document.getElementById ("OA"));
Alert (Ext.get (e));});
An HTML page contains a DIV with the ID of OA,
Ext.get ("OA"), Ext.get (document.getElementById ("OA"), Ext.get (e), and so on three methods can be obtained with a DOM node hello corresponding Ext element.
Two: 1. Ext.fly and Ext.get
Ext.fly is exactly the same as ext.get in terms of parameters, but its built-in control returns ext.element in a completely different way.
Ext.fly never saves a reference to an access meta object, and each invocation of the method returns a separate privilege object.
In fact, the difference is in "cache", because the cache, ext.get need to save their references for each element, it forms a cache,
If the same call is returned, but Ext.fly does not have a so-called caching mechanism, what gets returned is what,
If you use the element "one time" without multiple use, you should use Ext.fly (such as performing a single task).
Examples of using ext.fly:
Refer to this element once and get it done.
Ext.fly (' elId '). Hide ();
2, getcmp Method-get Ext component.
The getcmp method is used to obtain an ext component, which is an object of component or its subclasses that have been initialized in the page.
The getcmp method is actually a shorthand form of the Ext.ComponentMgr.get method. There is only one parameter in the GETCMP method, which is the ID of the component. For example, the following code:
Ext.onready (function () {var h=new ext.panel ({
ID: "H2", Title: ", Renderto:" Hello ", width:300,height:200});
In the code, we use EXT.GETCMP ("H2"). To get the component with ID H2,
Ext.js (iii)