1. Get ID
- Ext.get ("Elid")--Creates a new instance once per call
- Ext.fly ("Elid")--create only one instance at a time
- Ext.getdom ("Elid")--htmlelement
- Get DOM, Ext.fly (). Dom
2.CSS style operation
- Ext.fly ("Elid"). AddClass ("Elcss") (corresponding Removeclass,hasclass,replaceclass)
- Ext.fly ("Elid"). Toggleclass ("Elcss"), style switch
- GetStyle:Ext.fly ("Elid"). GetStyle ("Color")
- SetStyle:Ext.fly ("Elid"). SetStyle ({color: "Red", "font-weight": "Bold"})
3.DOM Query and traversal
- Is (selector): Ext.get ("Elid"). Is ("Div.elclass")
- Findparentnode (selector): Finds the parent node that matches the selector starting from the current node, and up(selector) is its abbreviation, but returns ext.element
- Select: Finds child nodes of the current node, ext.fly ("Elid"). Select ("div"), which can be accessed using each
- Query (selector): A.query ("Input.ipt")//return array
- Child:Ext.fly ("Elid"). Child ("div"), Ext.fly ("Elid"). ("Div", true)//return native
- ..... down,parent,next,prev,first,last
4.Dom operation
Ext.domhelper is a class used to generate HTML fragments, which are generated primarily by defining a JSON-formatted data.
<ul id= "ItemList", class= "list" ><li>1</li><li>1</li><li>1</li></ul >var list="ItemList" ,
Tag: "UL",
CLS: "List",
children:[
{tag: ' li ', HTML: ' 1 '},
{tag: ' li ', HTML: ' 2 '},
{tag: ' li ', HTML: ' 2 '}
]
}
var list={id: "ItemList" ,
Tag: "UL",
CLS: "List",
HTML: " <li>1</li><li>1</li><li>1</li>"
}
var a={
ID: "Link"
Tag: "A",
href: "url",
HTML: "Links"
}
- Append subkey: AppendChild
var el=ext.get ("Elid1"); Ext.fly (// ext.fly(///Ext.fly ("Eld") is appended by ID . AppendChild (el.dom) // append Ext.fly ("Eld") via Compositeelement . appendchild ( Ext.select ("div"))
Other
- return type: Ext.get (). $classname, if no this property indicates that the JS native object is returned
- return type: Check return type can use Ext.typeof ()-More than native
ExtJS Knowledge Point Overview