Reference extjs 2.0 learning notes (ext. Element API summary)

Source: Internet
Author: User
Tags gety

There are many Ext. Element APIs, and it is difficult for everyone to grasp the context and main functions in a short time. This is a summary, not an API description. Speaking of API instructions, there was a good online man.

Location settings:

Getx () obtains the X coordinate relative to the page.
Gety () obtains the Y coordinate relative to the page.
Getxy () obtains the X and Y coordinates relative to the page. Usage: ELE. getxy () [0]/[1]
Getoffsetsto (EL) gets the coordinates of the relative element El. the return value is [x, y].
Setx (x, animate) is set to the X coordinate of the page. If animate is set to true, the default animation effect is enabled.
Sety (Y, animate) Same as above
Setleft (left) set style. Left
Settop (top) set style. Top
Setright (right) set style. Right
Setbottom (bottom) sets style. Bottom
Setxy (Pos, animate) is set to X, Y, which is equivalent to setx and sety. Usage: setxy ([x, y], true)
Setlocation (X, Y, animate) is equivalent to setxy.
Getregion () return {Top = T, Left = L, width = W, Height = r}
Getheight (true | false) True does not include borders or margins, and false does
Getborderwidth (anthor)
Getpadding (anthor)
Getcomputedheight () includes the border and padding.
Getcomputedwidth ()
Getsize () is equivalent to getwidth, getheight {width: W, height: H}
Getstylesize (): Get style. Width and style. Height, excluding the border {width: W, height: H}
Getviewsize (): Obtain the size of the backview. {width: W, height: H}
Getvalue () is required if there is a value.
Setwidth (width, animate) set style. Width
Setheight (height, animate) set style. Height
Setsize (width, height, animate)
Setbounds (X, Y, width, height, animate) is equivalent to setsize, setxy
Setregion (Region, animate) is equivalent to setbounds
Getscroll () gets the horizontal and vertical offset of the current view in the document, and returns {left: l, top: t}

Setopacity (opacity, animate)
Getleft (local) False is equivalent to getx, true is equivalent to style. Left
Getright (local) False is equivalent to getx + getwidth, true is equivalent to getleft (true) + getwidth ()
Gettop (local) False is equivalent to Gety, true is equivalent to style. Top
Getbottom (local)
Position (Pos, zindex, x, y) string: POs, take static, relative, absolute, fixed
Zindex is set to Z order, X, Y is used to call setxy
Clearpositionsing (value) depends on the code
Clearpositioning: function (value ){
Value = value | '';
This. setstyle ({
"Left": value,
"Right": value,
"TOP": value,
"Bottom": value,
"Z-index ":"",
"Position": "static"
});
Return this;
}

The format of getpositioning () is as follows {......}
Setpositioning (PC) usage is the same as applystyles
Setlefttop (left, top) is to set style. Left, style. Top


MoveTo (X, Y, animate) is equivalent to setxy
Move (Direction, distance, animate) is very useful. It moves the direction of direction, taking T, L, R, and B.
Distance is the moving distance, and whether the animation effect is enabled for animate

Getanchorxy (anchor, local, S) gets the page X and Y coordinates aligned to a certain place.
Getcenterxy () gets the page X and Y coordinates aligned to the center of the viewport.
Getaligntoxy (El, P, O) obtains the page X and Y coordinates aligned to a certain element.

Alignto (element, position, offsets, animate) alignto (element, position, offsets, and animate) alignto (element, position, offsets, and animation) alignto
Anchorto (El, alignment, offsets, animate, monitorscroll, callback) alignment to elements


Center (Centerin) is aligned to the center of the View
Getbox (contentbox, local) contentbox = false includes the border, the internal margin local = false get page coordinates
Setbox (box, adjust, animate) box includes border and padding
Getframewidth (sides, onlycontentbox)

Repaint () force new elements

 


Style and attribute settings

Addclass (string/array classname)
Removeclass (string/array classname)
Replaceclass (string oldclassname, string newclassname)
Radioclass (string/array classname)
Toggleclass (string classname)
Setstyle (name, value)
Getstyle (name)
Hasclass (classname)

Addclassonclick (classname)
Addclassonfocus (classname)
Addclassonover (classname)
Hover (classsname, bool preventflicker)

Page operations:
Append (Ele)
Appendto (Ele)
Replace (Ele)
Replacewith (Ele)
Insertbefore (Ele)
Insertafter (Ele)
Insertfirst (Ele)
Inserthtml (where, HTML, returnel)
Insertsibling (El, where, returndom)
Remove ()
Createchild (config, htmlelement insertbefore, returndom)


First (selector, returndom)
Last (selector, returndom)
Next (selector, returndom)
Prev (selector, returndom)
Parent (selector, returndom)
Child (selector, returndom)
Up (selector, maxdepth)
Down (selector, maxdepth)

Query (selector)

Contains (htmlelement/string El)

Show (animate)
Hide (animate)
Toggle (animate)
Setvisible (Boolean visible, animate)


Update (HTML, loadscripts, callback)

Special
Hover (function overfn, function outfn, [object scope]): Ext. Element
Mask (MSG, msgcls)
Unmask ()
Load (string/function URL, [String/object Params], [function callback], [Boolean discardurl])
Focus ()
Blur ()


Event registration:
On (eventname, fun)
UN (eventname, fun)
Addlistenser/removelistenser/removealllisteners

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.