EXT core API (III)-Ext. Element

Source: Internet
Author: User
Ext. Element class

Element (string/htmlelement element, [Boolean forcenew])
Element Object created by ID or DOM Node

Element. Fly (string/htmlelement El, [String named]): Element
A global shared activity element is created by the ID or DOM node and can be named by named to avoid potential conflicts.

Element. Get (mixed El): Element
Obtain an Ext. Element object from the ID, Dom node, or an existing element.

Addclass (string/array classname): Ext. Element
Add one or more CSS class names to the element

Addclassonclick (string classname): Ext. Element
Add and remove CSS classes for click events

Addclassonfocus (string classname): Ext. Element
Add and remove CSS classes for getting and losing focus

Addclassonover (string classname, [Boolean preventflicker]): Ext. Element
Add and remove CSS classes for the move-in and remove event (this method does not actually use the preventflicker parameter)

Addkeylistener (number/array/Object/string key, function FN, [object scope]): Ext. keymap
Add a key for the object to listen to the key by a value or string or {key: (number or array), shift: (true/false), CTRL: (true/false), alt: (true/false)} these objects or their Arrays

Addkeymap (Object config): Ext. keymap
The function is the same as addkeylistener, but the parameter passing method is different.
Example:
El. addkeymap ({key: "AB", CTRL: True, FN: FN, scope: El });
And
El. addkeylistener ({key: "AB", CTRL: true}, FN, El );
It is equivalent to calling FN after pressing ctral + A or Ctrl + B.

addlistener (string eventname, function FN, [object scope], [object options]): void
defines event listening, eventname: event name, FN: event processing method, scrope: range. The options definition is complex and can contain the following attributes
scope {object}: Processing FN range
delegate {string }: A simple selector (filtering the target or finding the target's child node)
stopevent {Boolean}: blocks the event, which is equal to preventdefault + stoppropagation
preventdefault {Boolean }: stop default activity
stoppropagation {Boolean}: Stop event bubbling
normalized {Boolean}: Set to flase to allow browser events to replace Ext. eventobject
delay {number}: the number of milliseconds after the delay
single {Boolean}: run only once
buffer {number}: In Ext. util. scheduled Events in delayedtask
Of course, you may also customize parameters to pass in the function

Alignto (Mixed Element, string position, [array offsets], [Boolean/object animate]): Ext. Element
Alignment El to element and positon to indicate the alignment position. Optional.
TL upper left corner (default)
T Center
Tr upper right corner
L center of the left boundary
Center C
R center of the right boundary
BL lower left
Center under B
Bottom right corner of BR
Can position be used? Restricted movement cannot exceed the window
Offsets offset, in pixels
For details about animate, see the definition of animate.

Example: div1.alignto ('div2', 'c-Bl? ', [20, 0], true );
Use the default animation to align the center of div1 to the lower left corner of div2, and move 20 pixels to the right without exceeding the window.

Anchorto (Mixed Element, string position, [array offsets], [Boolean/object animate], [Boolean/number monitorscroll], function callback): Ext. Element
The function is similar to alignto, but it also triggers a realignto event when the window is redefined.
The monitorscroll parameter specifies whether to monitor the scroll bar behavior. If it is defined as a value, the delay is defined, in milliseconds. The default value is 50 ms,
Callback defines the call-back method after the completion of Animate

Animate (Object ARGs, [float duration], [function oncomplete], [String easing], [String animtype]): Ext. Element
Execute the animation.
ARGs: Target
Duration: Time Interval. The default value is 0.35.
Function: Call back method after completion
Easing: the default behavior method is easeout. The optional values are found in ext_base but not described. The following content is found in Yahoo UI.
Easenone: constant speed
Easein: starts slowly and accelerates
Easeout: starts fast and slows down
Easeboth: Start slowly and slow down
Easeinstrong: starts to slow and accelerates, the fourth power of T
Easeoutstrong: starts fast and slows down, the fourth power of T
Easebothstrong: starts to slow and slows down, the fourth power of T
Elasticin:
Elasticout:
Elasticboth:
Backin:
Backout:
Backboth:
Bouncein:
Bounceout:
Bounceboth:
Too much. Let's get started.
Animtype: Specifies the animation type. The default value is run. Optional values: color, motion, and scroll.

Appendchild (string/htmlelement/array/element/compositeelement El): Ext. Element
Add sub-element El (El must already exist)

Appendto (mixed El): Ext. Element
Add the current element to El

Applystyles (string/Object/function styles): Ext. Element
Apply a style. Styles is a string such as "width: 100px" or an object such as {width: "100px"}. A function is a function that returns such a string and an object, this is a useless instruction, because any parameter passing can be a function of the required type. see also setstyle

Autoheight ([Boolean animate], [float duration], [function oncomplete], [String easing]): Ext. Element
The adaptive height and parameters are all familiar. The only thing you need to note is that setTimeout is used in this method and the height will not change immediately.

Blur (): Ext. Element
Lose focus and ignore all exceptions

Boxwrap ([string class]): Ext. Element
Use a div of the specified style class to include the current element. The default value of class is X-Box.

Center ([mixed Centerin]): void
The simplified version of alignto is equivalent to alignto (Centerin | document, 'c-C'). The center of the current element is aligned to the center of the Centerin element.

Child (string selector, [Boolean returndom]): htmlelement/EXT. Element
Select the child node according to selector and return the HTML or ext element according to different instructions of returndom. If it is not defined or false, the Ext. element is returned.

Clean ([Boolean forcereclean]): void
Clear useless blank text nodes (I like this idea)

Clearopacity (): Ext. Element
Clear unnecessary elements in the current element style, clear filter in IE, and clear opacity/-moz-Opacity/-khtml-opacity in ff.

Clearpositioning ([string value]): Ext. Element
Clear positioning and restore to the default value, which is equivalent
This. setstyle ({"Left": value, "right": value, "TOP": value, "bottom": value, "Z-index": "", "position ": "static "});

Clip (): Ext. Element
Crop the overflow part and restore it with unclip ().

Contains (htmlelement/string El): Boolean
Whether El exists in the current element

Createchild (Object config, [htmlelement insertbefore], [Boolean returndom]): Ext. Element
Create a new subnode
Config: domhelper element object. If no tag is specified, div is used as the default tag. For details, see domhelper. If insertbefore is not defined, append

Createproxy (string/object config, [String/htmlelement renderto], [Boolean matchbox]): Ext. Element
Create a proxy Element
Config: the class name or domhelper config object of the proxy Element
Renderto: the HTML element or ID of the proxy element to be drawn
Matchbox: alignment or not

Createshim (): Ext. Element
Create an IFRAME whose classname is ext-Shim before the current element. What is the purpose?

Down (string selector, [Boolean returndom]): htmlelement/EXT. Element
Select child nodes using the style Selector

Enabledisplaymode ([String display]): Ext. Element
Setvisibilitymode

Findparent (string selector, [number/mixed maxdepth], [Boolean returnel]): htmlelement
Use the simple selector to find the ancestor node until maxdepth (the default value of the element maxdepth is 10, or the specified Dom node). If no value is found, null is returned.

Findparentnode (string selector, [number/mixed maxdepth], [Boolean returnel]): htmlelement
Use the simple selector to select DOM nodes from the parent Element

First ([String selector], [Boolean returndom]): Ext. Element/htmlelement
The first child node that meets the selector condition is obtained. The text node is skipped.

Focus (): Ext. Element
Get focus

Getaligntoxy (Mixed Element, string position, [array offsets]): Array
Obtain the XY coordinate value of the current element aligned to the element according to the position rule. For details about the position/offsets parameter, see alignto.

Getanchorxy ([string anchor], [object size], [Boolean local]): Array
For the anchor definition of the coordinate value specified by the current element anchor, see alignto. The default value is C.

Getattributens (string namespace, string name): String
The namespace attribute name is used,

Getborderwidth (string side): Number
Get the sum of the border specified by side. The side can be T, L, R, B, or any combination of them. For example, getborderwidth ("LR") is used to obtain the sum of the Left Border and the right border.

Getbottom (Boolean local): Number
Get the bottom ordinate of the current element, element ordinate + element height

Getbox ([Boolean contentbox], [Boolean local]): Object
Get the box object of the current element: {X, Y, width, height}

Getcenterxy (): Array
If the horizontal and vertical coordinate values of the current element to be centered and aligntoxy (document, 'c-C') are equivalent ')

Getcolor (string ATTR, string defaultvalue, [String prefix]): void
Obtain the color value of ATTR specified by the current element. If no value is specified, defualtvalue is returned. What is depressing is that it is not void. Why is it a void in the API? It should be a string

Getcomputedheight (): Number
The calculated height is obtained. One of the height values defined in offsetheight or CSS is obtained. If padding/borders is used, it is also calculated.

Getcomputedwidth (): Number
See getcomputedheight

Getframewidth (string sides): Number
Get the sum of the Border Width and padding width defined by sides. For the side definition, see getborderwidth.

Getheight ([Boolean contentheight]): Number
Returns the offsetheight of an element.

Getleft (Boolean local): Number
Obtain the abscissa

Getmargins ([String sides]): Object/Number
If no sides is defined, an object containing {left, top, width, height} is returned. Otherwise, the object returns the width specified by side. For the side definition, see getborderwidth.

Getoffsetsto (Mixed Element): Array
Calculates the offset from the element to the current element.

Getpadding (string side): Number
Obtains the sum of padding specified by side.

Getpositioning (): Object
Get the location information of the current element and return the objects with the following attributes: {position, left, right, top, bottom, Z-index}

Getregion (): Region
Obtain the region information of the current element, and return the Ext. Lib. region object {top, left, bottom, right} containing the following attributes}

Getright (Boolean local): Number
Right Boundary Value

Getscroll (): Object
Get an object indicating the position of the scroll bar {left, top}

Getsize ([Boolean contentsize]): Object
Obtain the object information consisting of width and height {width, height}

Getstyle (string property): String
Get the specified style value getstyles simplified version

Getstyles (string style1, string style2, string etc.): Object
Get the object composed of parameters
Example: El. getstyles ('color', 'font-size', 'width ')
{'Color': '# ffff', 'font-size': '13px', 'width': '100px '} may be returned '}

Gettop (Boolean local): Number
Obtain the vertex vertical sitting mark

Getupdater (): Ext. Updater
Obtains the Updater object of the current element. For more information, see Ext. Updater.

Getvalue (Boolean asnumber): String/Number
Obtains the value of the value attribute.

Getviewsize (): Object
Get the object {width, height} Given by clientheight and clientwidth}

Getwidth ([Boolean contentwidth]): Number
... There are so many such methods

Getx (): Number
Getxy (): Array
Gety (): Array
Get the page offset, which is the absolute coordinate.

Hasclass (string classname): Boolean
The Style Class classname exists in the DOM node of the current element.

Hide ([Boolean/object animate]): Ext. Element
Hide current element

Hover (function overfn, function outfn, [object scope]): Ext. Element
Set the move-in and remove event

Initdd (string group, object config, object overrides): Ext. dd. dd
Initddproxy (string group, object config, object overrides): Ext. dd. ddproxy
Initddtarget (string group, object config, object overrides): Ext. dd. ddtarget
This should be put in Ext. DD and used for dragging.

Insertafter (mixed El): Ext. Element
Insertbefore (mixed El): Ext. Element
Insertfirst (mixed/object El): Ext. Element
Insert the current element after the EL Element in the Dom...

Inserthtml (string where, string HTML, Boolean returnel)
Insert HTML content where optional beforebegin, afterbegin, beforeend, afterend

Insertsibling (mixed/Object/array El, [String where], [Boolean returndom]):
Insert or create El as the sibling node of the current element. The where option is before/after. The default value is before.

Is (string selector): Boolean
Verify that the current node matches the simple Selector

Isborderbox ()
Test different style rules to determine whether the current element uses a box with borders

Isdisplayed (): Boolean
Returns true if none is not specified for the display attribute.

Ismasked (): Boolean
Only when the current element has a mask and is visible is true? It is something that will be blurred before the input box does not get the value.

Isscrollable (): Boolean
Scroll?

Isvisible ([Boolean deep]): Boolean
Visible?

Last ([String selector], [Boolean returndom]): Ext. Element/htmlelement
See First

Load (string/function URL, [String/object Params], [function callback], [Boolean discardurl]): Ext. Element
Apply the update method of the current Updater directly

Mask ([String MSG], [String msgcls]): Element
Create a mask for the current object

Move (string direction, number distance, [Boolean/object animate]): Ext. Element
The element before the phase moves relative to the current position,
The possible value of direction is "L", "Left"-"r", "right"-"T", "TOP", "up"-"B ", "bottom", "down ".
Distance, indicating the distance to be moved, in pixels

MoveTo (number X, number y, [Boolean/object animate]): Ext. Element
Calls to the specified location

Next ([String selector], [Boolean returndom]): Ext. Element/htmlelement
The next sibling node that matches the selector,

On (string eventname, function FN, [object scope], [object options]): void
For details, see addlistener.

Position ([String POS], [number zindex], [number x], [number y]): void
Initialize the position of the current element. For POs, select relative/absolute/fixed.

Prev ([String selector], [Boolean returndom]): Ext. Element/htmlelement
The previous sibling node that matches the selector

Query (string selector): Array
Select a subnode using the style Selector

Radioclass (string/array classname): Ext. Element
Add a style or style array to the current element and remove the specified style from the sibling node.

Relayevent (string eventname, object): void
Forward the eventname event of the current element to the object at the same time.

Remove (): void
Deletes an element from the current Dom and removes it from the cache.

Removealllisteners (): Ext. Element
Remove all listeners

Removeclass (string/array classname): Ext. Element
Remove style classes

Removelistener (string eventname, function FN): Ext. Element
Remove the FN listener of event eventname

Repaint (): Ext. Element
Force the browser to repaint the current element

Replace (mixed El): Ext. Element
Replace El with the current element

Replaceclass (string oldclassname, string newclassname): Ext. Element
Replace style classes

Replacewith (mixed/object El): Ext. Element
Use El to replace the current element

Scroll (string direction, number distance, [Boolean/object animate]): Boolean
Scroll. Scroll ensures that the elements do not cross-border. For the direction and distance parameters, see move.

Scrollintoview ([mixed container], [Boolean hscroll]): Ext. Element
Scroll to the view in the iner

Scrollto (string side, number value, [Boolean/object animate]): Element
Basically the same as scroll method, but it is not guaranteed that the elements do not cross-border

Select (string selector, [Boolean unique]):
Different from query, the Select method returns a compositeelement or compositeelementlite object through the style selector,

Set (Object o, [Boolean useset]): Ext. Element
Set attributes, for example
El. Set ({width: '200px ', height: '200px '});

Setbottom (string bottom): Ext. Element
Setleft (string left): Ext. Element
Setright (string right): Ext. Element
Settop (string top): Ext. Element
Setlefttop (string left, string top): Ext. Element
Set the attribute value of a CSS object

Setbounds (number X, number y, number width, number height, [Boolean/object animate]): Ext. Element
Change the position and size of the current element immediately

Setbox (Object box, [Boolean adjust], [Boolean/object animate]): Ext. Element
Set a box for the current element: {X, Y, width, height}, adjust to indicate whether to adjust the size immediately

Setdisplayed (Boolean value): Ext. Element
Set visibility

Setheight (number height, [Boolean/object animate]): Ext. Element
Setwidth (number width, [Boolean/object animate]): Ext. Element
Setsize (number width, number height, [Boolean/object animate]): Ext. Element
Set height and width

Setlocation (number X, number y, [Boolean/object animate]): Ext. Element
Set the horizontal and vertical coordinates of the current element relative to the page

Setopacity (float opacity, [Boolean/object animate]): Ext. Element
Sets the transparency. The Opacity is 1, which is completely opaque and 0 is completely transparent.

Setpositioning (Object poscfg): Ext. Element
Specifies the location information for the current element. For details about the parameter poscfg, see getpositioning.

Setregion (ext. Lib. region, [Boolean/object animate]): Ext. Element
For details about specifying region information for the current element, see getregion.

Setstyle (string/Object Property, [string value]): Ext. Element
Set Style

Setvisibilitymode (vismode element. Visibility): Ext. Element
Indicates whether the visibility is defined using the element. visibility or element. Display attribute.

Setvisible (Boolean visible, [Boolean/object animate]): Ext. Element
Set visibility

Setx (number the, [Boolean/object animate]): Ext. Element
Setxy (array POs, [Boolean/object animate]): Ext. Element
Sety (number the, [Boolean/object animate]): Ext. Element
Set the position of the current element relative to the page

Show ([Boolean/object animate]): Ext. Element
Show current element

Swallowevent (string eventname, [Boolean preventdefault]): Ext. Element
Block eventname event bubbling and block default behavior based on preventdefault

Toggle ([Boolean/object animate]): Ext. Element
The visibility or display attribute of the element depends on the settings of setvisibilitymode.

Toggleclass (string classname): Ext. Element
If the style name exists in the DOM node corresponding to the current element, remove it. Otherwise, apply it.

Translatepoints (number/array X, number y): Object
Returns a {left, top} structure.

UN (string eventname, function FN): Ext. Element
To cancel event listening, see removelistener

Unclip (): Ext. Element
See clip;

Unmask (): void
See mask;

Unselectable (): Ext. Element
Disable Text Selection

Up (string selector, [number/mixed maxdepth]): Ext. Element
Select an ancestor node using the style Selector

Update (string HTML, [Boolean loadscripts], function callback): Ext. Element
Use HTML to update the content of the current node. loadscripts indicates whether to run scripts in HTML. This is an old problem of innerhtml.

Wrap ([object config], [Boolean returndom]): htmlelement/Element
Include yourself with another element config

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.